Class: Skeem::SkmArity
- Inherits:
-
Struct
- Object
- Struct
- Skeem::SkmArity
- Defined in:
- lib/skeem/s_expr_nodes.rb
Overview
class
Instance Attribute Summary collapse
-
#high ⇒ Object
Returns the value of attribute high.
-
#low ⇒ Object
Returns the value of attribute low.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#nullary? ⇒ Boolean
rubocop: disable Style/NumericPredicate.
-
#variadic? ⇒ Boolean
rubocop: enable Style/NumericPredicate.
Instance Attribute Details
#high ⇒ Object
Returns the value of attribute high
298 299 300 |
# File 'lib/skeem/s_expr_nodes.rb', line 298 def high @high end |
#low ⇒ Object
Returns the value of attribute low
298 299 300 |
# File 'lib/skeem/s_expr_nodes.rb', line 298 def low @low end |
Instance Method Details
#==(other) ⇒ Object
310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 |
# File 'lib/skeem/s_expr_nodes.rb', line 310 def ==(other) return true if object_id == other.object_id result = false case other when SkmArity result = true if (low == other.low) && (high == other.high) when Array result = true if (low == other.first) && (high == other.last) when Integer result = true if (low == other) && (high == other) end result end |
#nullary? ⇒ Boolean
rubocop: disable Style/NumericPredicate
301 302 303 |
# File 'lib/skeem/s_expr_nodes.rb', line 301 def nullary? low.zero? && high == 0 end |
#variadic? ⇒ Boolean
rubocop: enable Style/NumericPredicate
306 307 308 |
# File 'lib/skeem/s_expr_nodes.rb', line 306 def variadic? high == '*' end |