Class: Zapata::Primitive::Const

Inherits:
Basic show all
Defined in:
lib/zapata/primitive/const.rb

Instance Attribute Summary

Attributes inherited from Base

#code, #type

Instance Method Summary collapse

Methods inherited from Basic

#to_a

Methods inherited from Base

#dive_deeper, #initialize, #name, #return_with_missing_as_super, #return_with_super_as_missing

Constructor Details

This class inherits a constructor from Zapata::Primitive::Base

Instance Method Details

#nodeObject



6
7
8
9
10
# File 'lib/zapata/primitive/const.rb', line 6

def node
  modul, klass = @code.to_a
  type = @code.type
  OpenStruct.new(modul: modul, klass: klass, type: type)
end

#to_rawObject



12
13
14
# File 'lib/zapata/primitive/const.rb', line 12

def to_raw
  Raw.new(:const, [node.modul, node.klass].compact.join('::'))
end