Class: Zapata::Primitive::Var
- Inherits:
-
Base
- Object
- Base
- Zapata::Primitive::Var
show all
- Defined in:
- lib/zapata/primitive/var.rb
Instance Attribute Summary
Attributes inherited from Base
#code, #type
Instance Method Summary
collapse
Methods inherited from Base
#dive_deeper, #initialize, #name, #return_with_missing_as_super, #return_with_super_as_missing
Instance Method Details
#literal ⇒ Object
12
13
14
|
# File 'lib/zapata/primitive/var.rb', line 12
def literal
Diver.dive(node.body).literal
end
|
#node ⇒ Object
6
7
8
9
10
|
# File 'lib/zapata/primitive/var.rb', line 6
def node
name, body = @code.to_a
type = @code.type
OpenStruct.new(type: type, name: name, body: body)
end
|
#to_raw ⇒ Object
16
17
18
19
20
21
22
23
24
|
# File 'lib/zapata/primitive/var.rb', line 16
def to_raw
raw = Diver.dive(node.body).to_raw
if raw.type == :super
Missing.new(node.name).to_raw
else
raw
end
end
|