Class: Boolean
Instance Method Summary collapse
- #==(other) ⇒ Object
- #__value__ ⇒ Object
-
#initialize(value) ⇒ Boolean
constructor
A new instance of Boolean.
- #to_s ⇒ Object (also: #inspect)
Constructor Details
#initialize(value) ⇒ Boolean
Returns a new instance of Boolean.
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_s ⇒ Object Also known as: inspect
118 119 120 |
# File 'lib/quickbooks/ruby_ext.rb', line 118 def to_s @value.to_s end |