Class: RulerCoaster::Attributes::Result
- Inherits:
-
Object
- Object
- RulerCoaster::Attributes::Result
- Defined in:
- lib/ruler_coaster/attributes/result.rb
Instance Attribute Summary collapse
-
#blocked ⇒ Object
readonly
Returns the value of attribute blocked.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#input ⇒ Object
readonly
Returns the value of attribute input.
-
#rules ⇒ Object
readonly
Returns the value of attribute rules.
Instance Method Summary collapse
-
#initialize(rules, input, errors, blocked = {}) ⇒ Result
constructor
A new instance of Result.
- #success? ⇒ Boolean
Constructor Details
#initialize(rules, input, errors, blocked = {}) ⇒ Result
Returns a new instance of Result.
9 10 11 12 13 14 |
# File 'lib/ruler_coaster/attributes/result.rb', line 9 def initialize(rules, input, errors, blocked = {}) @rules = rules @input = input @errors = errors @blocked = blocked end |
Instance Attribute Details
#blocked ⇒ Object (readonly)
Returns the value of attribute blocked.
4 5 6 |
# File 'lib/ruler_coaster/attributes/result.rb', line 4 def blocked @blocked end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
4 5 6 |
# File 'lib/ruler_coaster/attributes/result.rb', line 4 def errors @errors end |
#input ⇒ Object (readonly)
Returns the value of attribute input.
4 5 6 |
# File 'lib/ruler_coaster/attributes/result.rb', line 4 def input @input end |
#rules ⇒ Object (readonly)
Returns the value of attribute rules.
4 5 6 |
# File 'lib/ruler_coaster/attributes/result.rb', line 4 def rules @rules end |
Instance Method Details
#success? ⇒ Boolean
16 17 18 |
# File 'lib/ruler_coaster/attributes/result.rb', line 16 def success? @errors.keys.empty? && @blocked.empty? end |