Class: Divine::StructDefinition
- Inherits:
-
Object
- Object
- Divine::StructDefinition
- Defined in:
- lib/divine/dsl.rb
Overview
Encapsulation basic struct information
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(owner, type, args) ⇒ StructDefinition
constructor
A new instance of StructDefinition.
-
#name ⇒ Object
Get struct’s name.
-
#to_s ⇒ Object
Represents strut as string.
- #type ⇒ Object
-
#version ⇒ Object
Get struct’s version.
Constructor Details
#initialize(owner, type, args) ⇒ StructDefinition
Returns a new instance of StructDefinition.
10 11 12 13 14 |
# File 'lib/divine/dsl.rb', line 10 def initialize(owner, type, args) @owner = owner @type = type @args = args end |
Instance Method Details
#name ⇒ Object
Get struct’s name
19 20 21 |
# File 'lib/divine/dsl.rb', line 19 def name @args.first end |
#to_s ⇒ Object
Represents strut as string
37 38 39 |
# File 'lib/divine/dsl.rb', line 37 def to_s "#{@owner.name}: #{self.type} #{self.name} (#{self.class.name}, #{@args.inspect})" end |
#type ⇒ Object
23 24 25 |
# File 'lib/divine/dsl.rb', line 23 def type @type end |
#version ⇒ Object
Get struct’s version
30 31 32 |
# File 'lib/divine/dsl.rb', line 30 def version @owner.version end |