Class: Datum

Inherits:
ValueAdd show all
Defined in:
lib/primitive_wrapper.rb

Overview

string, number

Instance Method Summary collapse

Methods inherited from ValueAdd

bestow_methods, capture_base_methods

Methods inherited from Value

#!=, #==, #ensure_valid, #freeze, freeze_raise?, ignore_on_freeze, #initialize, #inspect, #prim_value, raise_on_freeze, #replace, #unwrap, #val, #val=

Constructor Details

This class inherits a constructor from Value

Instance Method Details

#to_intObject



428
429
430
# File 'lib/primitive_wrapper.rb', line 428

def to_int
  Int.new @value.to_i
end

#to_sObject

methods that broke … fixed here



422
423
424
# File 'lib/primitive_wrapper.rb', line 422

def to_s
  @value.to_s    
end

#valid_type(prm) ⇒ Object



414
415
416
417
418
419
# File 'lib/primitive_wrapper.rb', line 414

def valid_type(prm)
  return true if prm.kind_of? Numeric
  return true if prm.kind_of? String
  return true if prm.kind_of? Datum
  false
end

#~Object

make sure capture did not muck things up



425
426
427
# File 'lib/primitive_wrapper.rb', line 425

def ~   # make sure capture did not muck things up
  @value   # If you need ~ use Int instead of Number
end