Class: Category

Inherits:
Struct show all
Defined in:
lib/models/category.rb

Overview

category.from_array(array) # => Array of Category objects

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Struct

from_hash

Instance Attribute Details

#annotationsObject

Returns the value of attribute annotations



12
13
14
# File 'lib/models/category.rb', line 12

def annotations
  @annotations
end

#categoryObject

Returns the value of attribute category



12
13
14
# File 'lib/models/category.rb', line 12

def category
  @category
end

#codeObject

Returns the value of attribute code



12
13
14
# File 'lib/models/category.rb', line 12

def code
  @code
end

#groupObject

Returns the value of attribute group



12
13
14
# File 'lib/models/category.rb', line 12

def group
  @group
end

#hiddenObject

Returns the value of attribute hidden



12
13
14
# File 'lib/models/category.rb', line 12

def hidden
  @hidden
end

Class Method Details

.from_array(array) ⇒ Object

Method from_array returns array of categories(create from json). Takes value of array objects as json parameter array.

Example:

Category.from_array([...array of JSON objects...]) # => Array of Category


21
22
23
24
25
# File 'lib/models/category.rb', line 21

def self.from_array(array)
  array.collect do |element|
    Category.new(element)
  end
end