Class: Unsigned

Inherits:
BasicObject
Defined in:
lib/identikey/unsigned.rb

Overview

Wrapper for an integer immediate value, that is used only as an annotation for typed_attributes_list_from() in order to generate the correct XSD type from an Object’s class.

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Unsigned

Returns a new instance of Unsigned.



7
8
9
10
11
12
13
# File 'lib/identikey/unsigned.rb', line 7

def initialize(value)
  @int = ::Kernel::Integer(value)

  if @int < 0
    raise ArgumentError, "Invalid input syntax for Unsigned integer: #{value}"
  end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args, &block) ⇒ Object



19
20
21
# File 'lib/identikey/unsigned.rb', line 19

def method_missing(meth, *args, &block)
  @int.public_send(meth, *args, &block)
end

Instance Method Details

#classObject



15
16
17
# File 'lib/identikey/unsigned.rb', line 15

def class
  ::Unsigned
end