Module: Assert::Factory::TypeConverter

Defined in:
lib/assert/factory.rb

Class Method Summary collapse

Class Method Details

.binary(input) ⇒ Object


95
# File 'lib/assert/factory.rb', line 95

def self.binary(input);    input;                      end

.boolean(input) ⇒ Object


94
# File 'lib/assert/factory.rb', line 94

def self.boolean(input);   !!input;                    end

.date(input) ⇒ Object


93
# File 'lib/assert/factory.rb', line 93

def self.date(input);      Date.parse(input.to_s);     end

.datetime(input) ⇒ Object


91
# File 'lib/assert/factory.rb', line 91

def self.datetime(input);  DateTime.parse(input.to_s); end

.float(input) ⇒ Object


90
# File 'lib/assert/factory.rb', line 90

def self.float(input);     input.to_f;                 end

.integer(input) ⇒ Object


89
# File 'lib/assert/factory.rb', line 89

def self.integer(input);   input.to_i;                 end

.string(input) ⇒ Object


88
# File 'lib/assert/factory.rb', line 88

def self.string(input);    input.to_s;                 end

.time(input) ⇒ Object


92
# File 'lib/assert/factory.rb', line 92

def self.time(input);      Time.parse(input.to_s);     end