Exception: SearchObject::InvalidNumberError

Inherits:
ArgumentError
  • Object
show all
Defined in:
lib/search_object/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(field, number) ⇒ InvalidNumberError

Returns a new instance of InvalidNumberError.



13
14
15
16
17
18
# File 'lib/search_object/errors.rb', line 13

def initialize(field, number)
  @field  = field
  @number = number

  super "#{field} should be more than 0. Currently '#{number}' is given."
end

Instance Attribute Details

#fieldObject (readonly)

Returns the value of attribute field.



11
12
13
# File 'lib/search_object/errors.rb', line 11

def field
  @field
end

#numberObject (readonly)

Returns the value of attribute number.



11
12
13
# File 'lib/search_object/errors.rb', line 11

def number
  @number
end