Class: Yet::Base
- Inherits:
-
Object
- Object
- Yet::Base
- Defined in:
- lib/yet/base.rb
Instance Method Summary collapse
-
#initialize(value, operations = []) ⇒ Base
constructor
A new instance of Base.
- #true_value ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(value, operations = []) ⇒ Base
Returns a new instance of Base.
5 6 7 8 |
# File 'lib/yet/base.rb', line 5 def initialize(value, operations = []) @value = value @operations = operations end |
Instance Method Details
#true_value ⇒ Object
20 21 22 |
# File 'lib/yet/base.rb', line 20 def true_value @value end |
#value ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/yet/base.rb', line 10 def value @operations.reduce(self) { |s, fn| begin s.map(&fn) rescue => e Yet.is_not(e) end }.true_value end |