Class: ActiveModel::Coercions::Types::Integer

Inherits:
Object
  • Object
show all
Defined in:
lib/active_model/coercions/types/integer.rb

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Integer

Returns a new instance of Integer.



5
6
7
# File 'lib/active_model/coercions/types/integer.rb', line 5

def initialize(value)
  @value = value
end

Instance Method Details

#to_valueObject



9
10
11
# File 'lib/active_model/coercions/types/integer.rb', line 9

def to_value
  @value.to_i
end