Class: Boolean

Inherits:
Object show all
Defined in:
lib/quickbooks/ruby_ext.rb

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Boolean

Returns a new instance of Boolean.

Raises:

  • (ArgumentError)


105
106
107
108
# File 'lib/quickbooks/ruby_ext.rb', line 105

def initialize(value)
  raise ArgumentError, "must be true or false!" unless ['true', 'false'].include?(value.to_s)
  @value = (value.to_s == 'true')
end

Instance Method Details

#==(other) ⇒ Object



114
115
116
# File 'lib/quickbooks/ruby_ext.rb', line 114

def ==(other)
  to_s == other.to_s
end

#__value__Object



110
111
112
# File 'lib/quickbooks/ruby_ext.rb', line 110

def __value__
  @value
end

#to_sObject Also known as: inspect



118
119
120
# File 'lib/quickbooks/ruby_ext.rb', line 118

def to_s
  @value.to_s
end