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.



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

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.



9
10
11
# File 'lib/search_object/errors.rb', line 9

def field
  @field
end

#numberObject (readonly)

Returns the value of attribute number.



9
10
11
# File 'lib/search_object/errors.rb', line 9

def number
  @number
end