Class: FFI::Generator::Constant

Inherits:
Node
  • Object
show all
Defined in:
lib/generator/constant.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.



4
5
6
7
# File 'lib/generator/constant.rb', line 4

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

Instance Method Details

#to_sObject



8
9
10
# File 'lib/generator/constant.rb', line 8

def to_s
  @indent_str + "#{@name} = #{sanitize!(@value)}"        
end