Class: RgGen::Core::Utility::CodeUtility::StructureDefinition
- Includes:
- RgGen::Core::Utility::CodeUtility
- Defined in:
- lib/rggen/core/utility/code_utility/structure_definition.rb
Instance Method Summary collapse
- #body(&block) ⇒ Object
-
#initialize ⇒ StructureDefinition
constructor
A new instance of StructureDefinition.
- #to_code ⇒ Object
Methods included from RgGen::Core::Utility::CodeUtility
array_name, code_block, colon, comma, #create_blank_code, indent, loop_index, newline, nl, semicolon, space, string, wrap
Constructor Details
#initialize ⇒ StructureDefinition
Returns a new instance of StructureDefinition.
10 11 12 |
# File 'lib/rggen/core/utility/code_utility/structure_definition.rb', line 10 def initialize block_given? && yield(self) end |
Instance Method Details
#body(&block) ⇒ Object
14 15 16 17 |
# File 'lib/rggen/core/utility/code_utility/structure_definition.rb', line 14 def body(&block) return unless block_given? (@bodies ||= []) << [block, 2] end |