Class: Amsi::AttributeParser::Integer

Inherits:
Base
  • Object
show all
Defined in:
lib/amsi/attribute_parser/integer.rb

Overview

Parse the response value of an integer attribute

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Amsi::AttributeParser::Base

Instance Method Details

#parseInteger

Returns the parsed attribute value.

Returns:

  • (Integer)

    the parsed attribute value



8
9
10
11
12
# File 'lib/amsi/attribute_parser/integer.rb', line 8

def parse
  Integer(value, 10)
rescue ArgumentError
  raise Error::InvalidResponse, "Invalid integer response value: #{value}"
end