Class: Retab::Category

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/classifications/category.rb

Constant Summary collapse

HASH_ATTRS =
{
  name: :name,
  handle_key: :handle_key,
  description: :description
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

#inspect, normalize, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ Category

Returns a new instance of Category.



19
20
21
22
23
24
# File 'lib/retab/classifications/category.rb', line 19

def initialize(json)
  hash = self.class.normalize(json)
  @name = hash[:name]
  @handle_key = hash[:handle_key]
  @description = hash[:description]
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



14
15
16
# File 'lib/retab/classifications/category.rb', line 14

def description
  @description
end

#handle_keyObject

Returns the value of attribute handle_key.



14
15
16
# File 'lib/retab/classifications/category.rb', line 14

def handle_key
  @handle_key
end

#nameObject

Returns the value of attribute name.



14
15
16
# File 'lib/retab/classifications/category.rb', line 14

def name
  @name
end