module Excom::Plugins::DryTypes
Attributes
attributes[RW]
Public Class Methods
new(attrs)
click to toggle source
Calls superclass method
# File lib/excom/plugins/dry_types.rb, line 15 def initialize(attrs) @attributes = self.class::Attributes.new(attrs) super end
used(service_class, *)
click to toggle source
# File lib/excom/plugins/dry_types.rb, line 8 def self.used(service_class, *) require 'dry-types' require 'dry-struct' service_class.const_set(:Attributes, Class.new(Dry::Struct)) end
Public Instance Methods
initialize_clone(*)
click to toggle source
Calls superclass method
# File lib/excom/plugins/dry_types.rb, line 21 def initialize_clone(*) @attributes = @attributes.dup super end
with_args(*)
click to toggle source
# File lib/excom/plugins/dry_types.rb, line 43 def with_args(*) raise("`with_args' method is not available with :dry_types plugin. use `with_attributes' method instead") end
with_attributes(attrs)
click to toggle source
# File lib/excom/plugins/dry_types.rb, line 26 def with_attributes(attrs) clone.tap do |copy| copy.attributes = self.class::Attributes.new(attributes.to_hash.merge(attrs)) end end
with_opts(*)
click to toggle source
# File lib/excom/plugins/dry_types.rb, line 47 def with_opts(*) raise("`with_opts' method is not available with :dry_types plugin. use `with_attributes' method instead") end
Private Instance Methods
assert_valid_args!(*)
click to toggle source
# File lib/excom/plugins/dry_types.rb, line 37 def assert_valid_args!(*) end
assert_valid_opts!(*)
click to toggle source
# File lib/excom/plugins/dry_types.rb, line 40 def assert_valid_opts!(*) end
resolve_args!(args)
click to toggle source
args and opts overloads
# File lib/excom/plugins/dry_types.rb, line 33 def resolve_args!(args) [nil, nil] end