Class: Renderer::Entities::Class
- Defined in:
- lib/renderer/entities/class.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#inherits ⇒ Object
Returns the value of attribute inherits.
Attributes inherited from Container
#classes, #constants, #defined_by, #defs, #doc, #extends, #includes, #modules, #sdefs
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(parent, model) ⇒ Class
constructor
A new instance of Class.
- #type ⇒ Object
Methods inherited from Container
#find_nested_container, #init_entities, #init_reference, #init_reference!, #init_references!, #resolve_class_path
Methods inherited from Base
#class?, #def?, #full_path, #inspect, #module?, #register_reference, #root, #root?, #static?, #to_s
Constructor Details
#initialize(parent, model) ⇒ Class
Returns a new instance of Class.
8 9 10 11 12 |
# File 'lib/renderer/entities/class.rb', line 8 def initialize(parent, model) super(parent, model) @attributes = model.fetch(:attributes, {}).map { |k, v| Attribute.new(self, k.to_s, v) } @inherits = init_reference(model[:inherits], :inherits) end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
6 7 8 |
# File 'lib/renderer/entities/class.rb', line 6 def attributes @attributes end |
#inherits ⇒ Object
Returns the value of attribute inherits.
6 7 8 |
# File 'lib/renderer/entities/class.rb', line 6 def inherits @inherits end |
Instance Method Details
#type ⇒ Object
14 |
# File 'lib/renderer/entities/class.rb', line 14 def type = :class |