Class: Skeem::SkmFormals
- Inherits:
-
Object
- Object
- Skeem::SkmFormals
- Defined in:
- lib/skeem/s_expr_nodes.rb
Overview
class
Instance Attribute Summary collapse
-
#arity ⇒ Object
readonly
Returns the value of attribute arity.
-
#formals ⇒ Object
readonly
Returns the value of attribute formals.
Instance Method Summary collapse
- #evaluate(aRuntime) ⇒ Object
-
#initialize(theFormals, arityKind) ⇒ SkmFormals
constructor
A new instance of SkmFormals.
- #nullary? ⇒ Boolean
- #required_arity ⇒ Object
- #variadic? ⇒ Boolean
Constructor Details
#initialize(theFormals, arityKind) ⇒ SkmFormals
Returns a new instance of SkmFormals.
522 523 524 525 |
# File 'lib/skeem/s_expr_nodes.rb', line 522 def initialize(theFormals, arityKind) @formals = theFormals arity_set(arityKind) end |
Instance Attribute Details
#arity ⇒ Object (readonly)
Returns the value of attribute arity.
519 520 521 |
# File 'lib/skeem/s_expr_nodes.rb', line 519 def arity @arity end |
#formals ⇒ Object (readonly)
Returns the value of attribute formals.
518 519 520 |
# File 'lib/skeem/s_expr_nodes.rb', line 518 def formals @formals end |
Instance Method Details
#evaluate(aRuntime) ⇒ Object
527 528 529 |
# File 'lib/skeem/s_expr_nodes.rb', line 527 def evaluate(aRuntime) formals.map! { |param| param.evaluate(aRuntime) } end |
#nullary? ⇒ Boolean
531 532 533 |
# File 'lib/skeem/s_expr_nodes.rb', line 531 def nullary? arity.nullary? end |
#required_arity ⇒ Object
539 540 541 |
# File 'lib/skeem/s_expr_nodes.rb', line 539 def required_arity (arity.high == '*') ? arity.low : arity.high end |
#variadic? ⇒ Boolean
535 536 537 |
# File 'lib/skeem/s_expr_nodes.rb', line 535 def variadic? arity.variadic? end |