Class: Mountapi::Schema::Number

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/mountapi/schema/number.rb

Overview

Schema implementation for Number type

Instance Method Summary collapse

Methods included from Base

included

Instance Method Details

#cast(value) ⇒ Object

cast value to float



10
11
12
13
14
# File 'lib/mountapi/schema/number.rb', line 10

def cast(value)
  Float(value)
rescue ArgumentError
  raise_cast_error(value)
end