Class: FFI::Generator::Constant

Inherits:
Node
  • Object
show all
Defined in:
lib/generator/generator.rb

Instance Attribute Summary

Attributes inherited from Node

#symname

Instance Method Summary collapse

Methods inherited from Node

#get_attr

Constructor Details

#initialize(params = { }) ⇒ Constant

Returns a new instance of Constant.



166
167
168
169
# File 'lib/generator/generator.rb', line 166

def initialize(params = { })
  super
  @name, @value = get_attr('sym_name'), get_attr('value')
end

Instance Method Details

#to_sObject



170
171
172
# File 'lib/generator/generator.rb', line 170

def to_s
  @indent_str + "#{@name} = #{@value}"        
end