Class: V2Intuity::Headers::Header

Inherits:
Object
  • Object
show all
Defined in:
lib/v2_intuity/headers/header.rb

Direct Known Subclasses

Accept, ContentType

Constant Summary collapse

HEADERS =
{ accept: 'accept', content_type: 'content_type' }.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Header

Returns a new instance of Header.



7
8
9
10
# File 'lib/v2_intuity/headers/header.rb', line 7

def initialize(options = {})
  @name = options[:name]
  @value = options[:value]
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/v2_intuity/headers/header.rb', line 4

def name
  @name
end

#valueObject

Returns the value of attribute value.



4
5
6
# File 'lib/v2_intuity/headers/header.rb', line 4

def value
  @value
end

Instance Method Details

#to_hashObject



12
13
14
# File 'lib/v2_intuity/headers/header.rb', line 12

def to_hash
  { @name.to_sym => @value }
end