Exception: HumanTone::Coercion::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/humantone/coercion.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(field, reason) ⇒ Error

Returns a new instance of Error.



10
11
12
13
14
# File 'lib/humantone/coercion.rb', line 10

def initialize(field, reason)
  @field = field
  @reason = reason
  super("#{field}: #{reason}")
end

Instance Attribute Details

#fieldObject (readonly)

Returns the value of attribute field.



8
9
10
# File 'lib/humantone/coercion.rb', line 8

def field
  @field
end

#reasonObject (readonly)

Returns the value of attribute reason.



8
9
10
# File 'lib/humantone/coercion.rb', line 8

def reason
  @reason
end