Module: AWS::Core::OptionGrammar::Descriptors::Bigdecimal

Extended by:
NoArgs
Defined in:
lib/aws/core/option_grammar.rb

Instance Method Summary collapse

Methods included from NoArgs

apply

Instance Method Details

#hash_format(value) ⇒ Object



421
422
423
# File 'lib/aws/core/option_grammar.rb', line 421

def hash_format(value)
  BigDecimal(value.to_s)
end

#validate(value, context = nil) ⇒ Object



415
416
417
418
419
# File 'lib/aws/core/option_grammar.rb', line 415

def validate(value, context = nil)
  raise format_error("decimal value", context) unless
    value.kind_of?(Numeric) or
    value.respond_to?(:to_int)
end