Class: SFRP::Low::Structure
Instance Method Summary collapse
-
#initialize(kind_str, name_str, members) ⇒ Structure
constructor
A new instance of Structure.
- #pretty_code ⇒ Object
Methods inherited from Element
Constructor Details
#initialize(kind_str, name_str, members) ⇒ Structure
Returns a new instance of Structure.
60 61 62 63 64 |
# File 'lib/sfrp/low/element.rb', line 60 def initialize(kind_str, name_str, members) @kind_str = kind_str @name_str = name_str @members = members end |
Instance Method Details
#pretty_code ⇒ Object
66 67 68 69 |
# File 'lib/sfrp/low/element.rb', line 66 def pretty_code inner = @members.map { |m| m.pretty_code(1) + "\n" }.join "#{@kind_str} #{@name_str} {\n#{inner}};" end |