Class: Smartdown::Model::Predicate::Function
- Inherits:
-
Struct
- Object
- Struct
- Smartdown::Model::Predicate::Function
- Defined in:
- lib/smartdown/model/predicate/function.rb
Instance Attribute Summary collapse
-
#arguments ⇒ Object
Returns the value of attribute arguments.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
Instance Attribute Details
#arguments ⇒ Object
Returns the value of attribute arguments
4 5 6 |
# File 'lib/smartdown/model/predicate/function.rb', line 4 def arguments @arguments end |
#name ⇒ Object
Returns the value of attribute name
4 5 6 |
# File 'lib/smartdown/model/predicate/function.rb', line 4 def name @name end |
Instance Method Details
#evaluate(state) ⇒ Object
5 6 7 |
# File 'lib/smartdown/model/predicate/function.rb', line 5 def evaluate(state) state.get(name).call(*evaluate_arguments(state)) end |
#humanize ⇒ Object
9 10 11 |
# File 'lib/smartdown/model/predicate/function.rb', line 9 def humanize "#{name}(#{arguments.join(' ')})" end |