Class: Bluepine::Functions::Result
- Inherits:
-
Object
- Object
- Bluepine::Functions::Result
- Defined in:
- lib/bluepine/functions.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #compose(f) ⇒ Object
-
#initialize(value, errors = nil) ⇒ Result
constructor
A new instance of Result.
Constructor Details
#initialize(value, errors = nil) ⇒ Result
Returns a new instance of Result.
7 8 9 10 |
# File 'lib/bluepine/functions.rb', line 7 def initialize(value, errors = nil) @value = value @errors = errors end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
5 6 7 |
# File 'lib/bluepine/functions.rb', line 5 def errors @errors end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
5 6 7 |
# File 'lib/bluepine/functions.rb', line 5 def value @value end |
Instance Method Details
#compose(f) ⇒ Object
12 13 14 15 16 |
# File 'lib/bluepine/functions.rb', line 12 def compose(f) return self if errors f.(value) end |