class TestHeaders
Public Class Methods
new(options={})
click to toggle source
# File lib/stitches/spec/test_headers.rb, line 3 def initialize(options={}) full_mimetype = mime_type(options) @headers = { "Accept" => full_mimetype, "Content-Type" => full_mimetype, }.tap { |headers| set_authorization_header(headers,options) } end
Public Instance Methods
headers()
click to toggle source
# File lib/stitches/spec/test_headers.rb, line 13 def headers @headers end
Private Instance Methods
mime_type(options)
click to toggle source
# File lib/stitches/spec/test_headers.rb, line 19 def mime_type(options) version_number = if options.key?(:version) options.delete(:version) else "1" end version = "; version=#{version_number}" if version_number mime_type = if options.key?(:mime_type) options.delete(:mime_type) else "application/json" end "#{mime_type}#{version}" end