Class: Fullstack::Admin::Group

Inherits:
Entity
  • Object
show all
Defined in:
lib/fullstack/admin/resources.rb

Overview

Group

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Entity

#leaf?, #traverse_bottom_up, #traverse_top_down

Constructor Details

#initialize(name) ⇒ Group

Returns a new instance of Group.



66
67
68
69
# File 'lib/fullstack/admin/resources.rb', line 66

def initialize(name)
  @name = "#{name}"
  @children = []
end

Instance Attribute Details

#childrenObject

Returns the value of attribute children.



64
65
66
# File 'lib/fullstack/admin/resources.rb', line 64

def children
  @children
end

#iconObject

Returns the value of attribute icon.



64
65
66
# File 'lib/fullstack/admin/resources.rb', line 64

def icon
  @icon
end

#nameObject

Returns the value of attribute name.



64
65
66
# File 'lib/fullstack/admin/resources.rb', line 64

def name
  @name
end

Instance Method Details

#resource(name) ⇒ Object



71
72
73
# File 'lib/fullstack/admin/resources.rb', line 71

def resource(name)
  @children << Resource.new(name)
end

#typeObject



75
76
77
# File 'lib/fullstack/admin/resources.rb', line 75

def type
  :group
end