Module: Dry::Types::Options
- Included in:
- Decorator, Definition, Sum
- Defined in:
- lib/dry/types/options.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/dry/types/options.rb', line 4 def @options end |
Instance Method Details
#initialize(*args, **options) ⇒ Object
6 7 8 9 10 |
# File 'lib/dry/types/options.rb', line 6 def initialize(*args, **) @__args__ = args @options = @meta = .fetch(:meta, {}) end |
#meta(data = nil) ⇒ Object
16 17 18 |
# File 'lib/dry/types/options.rb', line 16 def (data = nil) data ? with(meta: @meta.merge(data)) : @meta end |
#with(new_options) ⇒ Object
12 13 14 |
# File 'lib/dry/types/options.rb', line 12 def with() self.class.new(*@__args__, .merge()) end |