Class: Fullstack::Admin::Resource

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

Overview

Resource

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject

Returns the value of attribute name.



85
86
87
# File 'lib/fullstack/admin/resources.rb', line 85

def name
  @name
end

Instance Method Details

#childrenObject



98
99
100
# File 'lib/fullstack/admin/resources.rb', line 98

def children
  @children ||= [].freeze
end

#typeObject



94
95
96
# File 'lib/fullstack/admin/resources.rb', line 94

def type
  :resource
end