Class: Phoney::RuleGroup
- Inherits:
-
Object
- Object
- Phoney::RuleGroup
- Defined in:
- lib/phoney/rules.rb
Instance Attribute Summary collapse
-
#rules ⇒ Object
readonly
Returns the value of attribute rules.
-
#significant_digits ⇒ Object
readonly
Returns the value of attribute significant_digits.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #add_rule(rule) ⇒ Object
- #delete_rule(rule) ⇒ Object
-
#initialize(significant_digits, rules = []) ⇒ RuleGroup
constructor
A new instance of RuleGroup.
Constructor Details
Instance Attribute Details
#rules ⇒ Object (readonly)
Returns the value of attribute rules.
3 4 5 |
# File 'lib/phoney/rules.rb', line 3 def rules @rules end |
#significant_digits ⇒ Object (readonly)
Returns the value of attribute significant_digits.
3 4 5 |
# File 'lib/phoney/rules.rb', line 3 def significant_digits @significant_digits end |
Instance Method Details
#<=>(other) ⇒ Object
22 23 24 |
# File 'lib/phoney/rules.rb', line 22 def <=>(other) other.significant_digits <=> significant_digits end |
#add_rule(rule) ⇒ Object
14 15 16 |
# File 'lib/phoney/rules.rb', line 14 def add_rule(rule) @rules.push rule end |
#delete_rule(rule) ⇒ Object
18 19 20 |
# File 'lib/phoney/rules.rb', line 18 def delete_rule(rule) @rules.delete rule end |