Class: Mlc::Abstract::Call
- Inherits:
-
Object
- Object
- Mlc::Abstract::Call
- Defined in:
- lib/mlc/abstract/call.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#name ⇒ Object
Returns the value of attribute name.
-
#object ⇒ Object
Returns the value of attribute object.
Instance Method Summary collapse
-
#initialize ⇒ Call
constructor
A new instance of Call.
- #to_lua(indent, options, state) ⇒ Object
Constructor Details
#initialize ⇒ Call
Returns a new instance of Call.
6 7 8 |
# File 'lib/mlc/abstract/call.rb', line 6 def initialize @args = [] end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
5 6 7 |
# File 'lib/mlc/abstract/call.rb', line 5 def args @args end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/mlc/abstract/call.rb', line 4 def name @name end |
#object ⇒ Object
Returns the value of attribute object.
4 5 6 |
# File 'lib/mlc/abstract/call.rb', line 4 def object @object end |
Instance Method Details
#to_lua(indent, options, state) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/mlc/abstract/call.rb', line 10 def to_lua(indent, , state) obj = @object.to_lua(indent + 1, , state) args = @args.dup.unshift Raw.new('nil') name = "m#{@name}" if name =~ /^[A-Za-z][A-Za-z0-1_]*$/ "#{obj}:#{name}#{Mlc.prepare_args(indent, options, state, args)}" else args.unshift Raw.new("'#{Mlc.escape_str(name)}'") "#{obj}:_call#{Mlc.prepare_args(indent, options, state, args)}" end end |