class Zapata::Primitive::Base
Attributes
code[RW]
type[RW]
Public Class Methods
new(code)
click to toggle source
# File lib/zapata/primitive/base.rb, line 8 def initialize(code) @code = code @type = code.type end
Public Instance Methods
dive_deeper()
click to toggle source
# File lib/zapata/primitive/base.rb, line 17 def dive_deeper return if RETURN_TYPES.include?(node.type) Diver.dive(node.args) Diver.dive(node.body) end
name()
click to toggle source
# File lib/zapata/primitive/base.rb, line 13 def name SaveManager.clean(node.name) end
return_with_missing_as_super(raw, name)
click to toggle source
# File lib/zapata/primitive/base.rb, line 32 def return_with_missing_as_super(raw, name) raw.type == :missing ? Raw.new(:super, name) : raw end
return_with_super_as_missing(raw, primitive)
click to toggle source
# File lib/zapata/primitive/base.rb, line 28 def return_with_super_as_missing(raw, primitive) raw.type == :super ? Missing.new(primitive.name).to_raw : raw end
to_raw()
click to toggle source
# File lib/zapata/primitive/base.rb, line 24 def to_raw Diver.dive(node.body).to_raw end