Class: Dry::Monads::List::ListBuilder
- Inherits:
-
Object
- Object
- Dry::Monads::List::ListBuilder
- Defined in:
- lib/dry/monads/list.rb
Instance Attribute Summary collapse
- #type ⇒ Object readonly
Instance Method Summary collapse
- #[](*args) ⇒ Object
- #coerce(value) ⇒ Object
-
#initialize(type) ⇒ ListBuilder
constructor
A new instance of ListBuilder.
- #pure(val = Undefined, &block) ⇒ Object
Constructor Details
#initialize(type) ⇒ ListBuilder
Returns a new instance of ListBuilder.
357 |
# File 'lib/dry/monads/list.rb', line 357 def initialize(type) = @type = type |
Instance Attribute Details
#type ⇒ Object (readonly)
355 356 357 |
# File 'lib/dry/monads/list.rb', line 355 def type @type end |
Instance Method Details
#[](*args) ⇒ Object
359 |
# File 'lib/dry/monads/list.rb', line 359 def [](*args) = List.new(args, type) |
#coerce(value) ⇒ Object
361 |
# File 'lib/dry/monads/list.rb', line 361 def coerce(value) = List.coerce(value, type) |
#pure(val = Undefined, &block) ⇒ Object
363 364 365 366 |
# File 'lib/dry/monads/list.rb', line 363 def pure(val = Undefined, &block) value = Undefined.default(val, block) List.pure(value, type) end |