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