Class: SinglePlatform::MenuSection

Inherits:
Object
  • Object
show all
Defined in:
lib/single_platform/menu_section.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(menu, data) ⇒ MenuSection

Returns a new instance of MenuSection.



5
6
7
8
9
10
11
# File 'lib/single_platform/menu_section.rb', line 5

def initialize(menu, data)
  @menu = menu
  @menu_items = []
  data.each do |key, value|
    instance_variable_set :"@#{key.underscore}", value
  end
end

Instance Attribute Details

#descObject (readonly)

Returns the value of attribute desc.



3
4
5
# File 'lib/single_platform/menu_section.rb', line 3

def desc
  @desc
end

#idObject (readonly)

Returns the value of attribute id.



3
4
5
# File 'lib/single_platform/menu_section.rb', line 3

def id
  @id
end

Returns the value of attribute menu.



2
3
4
# File 'lib/single_platform/menu_section.rb', line 2

def menu
  @menu
end

Returns the value of attribute menu_items.



2
3
4
# File 'lib/single_platform/menu_section.rb', line 2

def menu_items
  @menu_items
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/single_platform/menu_section.rb', line 3

def name
  @name
end

#order_numObject (readonly)

Returns the value of attribute order_num.



3
4
5
# File 'lib/single_platform/menu_section.rb', line 3

def order_num
  @order_num
end

#titleObject (readonly)

Returns the value of attribute title.



3
4
5
# File 'lib/single_platform/menu_section.rb', line 3

def title
  @title
end

#typeObject (readonly)

Returns the value of attribute type.



3
4
5
# File 'lib/single_platform/menu_section.rb', line 3

def type
  @type
end