Class: Fullstack::Admin::Resource
- Defined in:
- lib/fullstack/admin/resources.rb
Overview
Resource
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #children ⇒ Object
-
#initialize(name) ⇒ Resource
constructor
A new instance of Resource.
- #type ⇒ Object
Methods inherited from Entity
#leaf?, #traverse_bottom_up, #traverse_top_down
Constructor Details
#initialize(name) ⇒ Resource
Returns a new instance of Resource.
87 88 89 90 91 92 |
# File 'lib/fullstack/admin/resources.rb', line 87 def initialize(name) if name.is_a?(Class) name = name.name end @name = "#{name}" end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
85 86 87 |
# File 'lib/fullstack/admin/resources.rb', line 85 def name @name end |
Instance Method Details
#children ⇒ Object
98 99 100 |
# File 'lib/fullstack/admin/resources.rb', line 98 def children @children ||= [].freeze end |
#type ⇒ Object
94 95 96 |
# File 'lib/fullstack/admin/resources.rb', line 94 def type :resource end |