Class: RgGen::Core::InputBase::Component

Inherits:
Base::Component show all
Defined in:
lib/rggen/core/input_base/component.rb

Instance Attribute Summary

Attributes inherited from Base::Component

#children, #component_index, #depth, #layer, #parent

Instance Method Summary collapse

Methods inherited from Base::Component

#add_child, #ancestors, #component_name, #feature, #features, #initialize, #need_children?, #need_no_children

Constructor Details

This class inherits a constructor from RgGen::Core::Base::Component

Instance Method Details

#add_feature(feature) ⇒ Object



7
8
9
10
# File 'lib/rggen/core/input_base/component.rb', line 7

def add_feature(feature)
  super
  define_proxy_calls(feature, feature.properties)
end

#document_onlyObject



12
13
14
# File 'lib/rggen/core/input_base/component.rb', line 12

def document_only
  @document_only = true
end

#document_only?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/rggen/core/input_base/component.rb', line 16

def document_only?
  instance_variable_defined?(:@document_only) && @document_only
end

#post_buildObject



24
25
26
# File 'lib/rggen/core/input_base/component.rb', line 24

def post_build
  features.each(&:post_build)
end

#printablesObject



33
34
35
# File 'lib/rggen/core/input_base/component.rb', line 33

def printables
  features.select(&:printable?).flat_map(&:printables).to_h
end

#propertiesObject



20
21
22
# File 'lib/rggen/core/input_base/component.rb', line 20

def properties
  features.flat_map(&:properties)
end

#verify(scope) ⇒ Object



28
29
30
31
# File 'lib/rggen/core/input_base/component.rb', line 28

def verify(scope)
  features.each { |feature| feature.verify(scope) }
  children.each { |child| child.verify(scope) } if scope == :all
end