Exception: Foobara::DomainMapperLookups::NoDomainMapperFoundError

Inherits:
StandardError
  • Object
show all
Defined in:
foobara-0.0.110/projects/domain_mapper/src/domain_mapper_lookups.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(from, to, **opts) ⇒ NoDomainMapperFoundError

Returns a new instance of NoDomainMapperFoundError.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'foobara-0.0.110/projects/domain_mapper/src/domain_mapper_lookups.rb', line 6

def initialize(from, to, **opts)
  valid_keys = [:value]
  invalid_keys = opts.keys - [:value]

  if invalid_keys.any?
    # :nocov:
    raise ArgumentError, "Invalid keys: #{invalid_keys.join(", ")}. expected one of: #{valid_keys.join(", ")}"
    # :nocov:
  end

  if opts.key?(:value)
    self.has_value = true
    self.value = opts[:value]
  end

  self.from = from
  self.to = to

  super("No domain mapper found for #{value}. from: #{from}. to: #{to}.")
end

Instance Attribute Details

#fromObject

Returns the value of attribute from.



4
5
6
# File 'foobara-0.0.110/projects/domain_mapper/src/domain_mapper_lookups.rb', line 4

def from
  @from
end

#has_valueObject

Returns the value of attribute has_value.



4
5
6
# File 'foobara-0.0.110/projects/domain_mapper/src/domain_mapper_lookups.rb', line 4

def has_value
  @has_value
end

#toObject

Returns the value of attribute to.



4
5
6
# File 'foobara-0.0.110/projects/domain_mapper/src/domain_mapper_lookups.rb', line 4

def to
  @to
end

#valueObject

Returns the value of attribute value.



4
5
6
# File 'foobara-0.0.110/projects/domain_mapper/src/domain_mapper_lookups.rb', line 4

def value
  @value
end