Class: TwicasStream::TwicasApiObject::SubCategory

Inherits:
Object
  • Object
show all
Defined in:
lib/twicas_stream/twicas_api_object/sub_category.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(elements = []) ⇒ SubCategory

Returns a new instance of SubCategory.



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/twicas_stream/twicas_api_object/sub_category.rb', line 9

def initialize elements = []
  @objects = Array.new

  elements.each{ |element|
    object = {
          :id    => element['id'],
          :name  => element['name'],
          :count => element['count']
        }

    @objects.push object
  }
end

Instance Attribute Details

#objectsObject (readonly)

Returns the value of attribute objects.



7
8
9
# File 'lib/twicas_stream/twicas_api_object/sub_category.rb', line 7

def objects
  @objects
end