Class: GRel::NonNegativeInteger
- Inherits:
-
Object
- Object
- GRel::NonNegativeInteger
- Defined in:
- lib/grel.rb
Overview
XML Scheam NonNegativeInteger type
Instance Method Summary collapse
-
#initialize(number) ⇒ NonNegativeInteger
constructor
Just wraps a numeric type.
- #method_missing(name, *args, &blk) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(number) ⇒ NonNegativeInteger
Just wraps a numeric type
48 49 50 |
# File 'lib/grel.rb', line 48 def initialize(number) @number = number end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &blk) ⇒ Object
52 53 54 55 |
# File 'lib/grel.rb', line 52 def method_missing(name, *args, &blk) ret = @number.send(name, *args, &blk) ret.is_a?(Numeric) ? MyNum.new(ret) : ret end |
Instance Method Details
#to_s ⇒ Object
57 58 59 |
# File 'lib/grel.rb', line 57 def to_s "\"#{@number}\"^^<http://www.w3.org/2001/XMLSchema#nonNegativeInteger>" end |