Class: Renderer::Entities::Class

Inherits:
Container show all
Defined in:
lib/renderer/entities/class.rb

Instance Attribute Summary collapse

Attributes inherited from Container

#classes, #constants, #defined_by, #defs, #doc, #extends, #includes, #modules, #sdefs

Attributes inherited from Base

#name, #parent, #references

Instance Method Summary collapse

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

#attributesObject

Returns the value of attribute attributes.



6
7
8
# File 'lib/renderer/entities/class.rb', line 6

def attributes
  @attributes
end

#inheritsObject

Returns the value of attribute inherits.



6
7
8
# File 'lib/renderer/entities/class.rb', line 6

def inherits
  @inherits
end

Instance Method Details

#typeObject



14
# File 'lib/renderer/entities/class.rb', line 14

def type = :class