Class: Zapata::Primitive::Def
- Inherits:
-
Base
- Object
- Base
- Zapata::Primitive::Def
show all
- Defined in:
- lib/zapata/primitive/def.rb
Instance Attribute Summary collapse
Attributes inherited from Base
#code, #type
Instance Method Summary
collapse
Methods inherited from Base
#dive_deeper, #name, #return_with_missing_as_super, #return_with_super_as_missing, #to_raw
Constructor Details
#initialize(code) ⇒ Def
Returns a new instance of Def.
Instance Attribute Details
#klass ⇒ Object
Returns the value of attribute klass.
6
7
8
|
# File 'lib/zapata/primitive/def.rb', line 6
def klass
@klass
end
|
Instance Method Details
#literal_predicted_args ⇒ Object
30
31
32
|
# File 'lib/zapata/primitive/def.rb', line 30
def literal_predicted_args
Predictor::Args.literal(node.args)
end
|
#node ⇒ Object
24
25
26
27
28
|
# File 'lib/zapata/primitive/def.rb', line 24
def node
name, args, body = @code.to_a
type = @code.type
OpenStruct.new(type: type, name: name, args: args, body: body)
end
|
#public? ⇒ Boolean
20
21
22
|
# File 'lib/zapata/primitive/def.rb', line 20
def public?
@access_level == :public
end
|
#self? ⇒ Boolean
16
17
18
|
# File 'lib/zapata/primitive/def.rb', line 16
def self?
!!@self
end
|