Class: Interscript::Node::Rule::Funcall
- Inherits:
-
Interscript::Node::Rule
- Object
- Interscript::Node
- Interscript::Node::Rule
- Interscript::Node::Rule::Funcall
- Defined in:
- lib/interscript/node/rule/funcall.rb
Instance Attribute Summary collapse
-
#kwargs ⇒ Object
Returns the value of attribute kwargs.
-
#name ⇒ Object
Returns the value of attribute name.
-
#reverse_run ⇒ Object
Returns the value of attribute reverse_run.
Instance Method Summary collapse
- #== ⇒ Object
-
#initialize(name, reverse_run: nil, **kwargs) ⇒ Funcall
constructor
A new instance of Funcall.
- #inspect ⇒ Object
- #reverse ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(name, reverse_run: nil, **kwargs) ⇒ Funcall
Returns a new instance of Funcall.
3 4 5 6 7 |
# File 'lib/interscript/node/rule/funcall.rb', line 3 def initialize name, reverse_run: nil, **kwargs @name = name @reverse_run = reverse_run @kwargs = kwargs end |
Instance Attribute Details
#kwargs ⇒ Object
Returns the value of attribute kwargs.
2 3 4 |
# File 'lib/interscript/node/rule/funcall.rb', line 2 def kwargs @kwargs end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/interscript/node/rule/funcall.rb', line 2 def name @name end |
#reverse_run ⇒ Object
Returns the value of attribute reverse_run.
2 3 4 |
# File 'lib/interscript/node/rule/funcall.rb', line 2 def reverse_run @reverse_run end |
Instance Method Details
#== ⇒ Object
21 22 23 |
# File 'lib/interscript/node/rule/funcall.rb', line 21 def == super && self.name == other.name && self.kwargs == other.kwargs end |
#inspect ⇒ Object
25 26 27 |
# File 'lib/interscript/node/rule/funcall.rb', line 25 def inspect "#{@name} #{kwargs.inspect[1..-2]}" end |
#reverse ⇒ Object
16 17 18 19 |
# File 'lib/interscript/node/rule/funcall.rb', line 16 def reverse self.class.new(Interscript::Stdlib.reverse_function[@name.to_sym], reverse_run: reverse_run.nil? ? nil : !reverse_run, **kwargs) end |
#to_hash ⇒ Object
9 10 11 12 13 14 |
# File 'lib/interscript/node/rule/funcall.rb', line 9 def to_hash { :class => self.class.to_s, :name => self.name, :kwargs => self.kwargs } end |