class Mhc::PropertyValue::Integer

Public Instance Methods

parse(string) click to toggle source
# File lib/mhc/property_value/integer.rb, line 4
def parse(string)
  if /^\d+$/ =~ string
    @value = string.to_i
  else
    raise ParseError, "invalid integer format \"#{string}\""
  end
  return self
end
to_i() click to toggle source
# File lib/mhc/property_value/integer.rb, line 13
def to_i
  @value.to_i
end