Class: Boolean
- Inherits:
-
Object
- Object
- Boolean
- Defined in:
- lib/rxsd/builtin_types.rb
Overview
Ruby doesn’t define a Boolean class, so we define one ourselves
Class Method Summary collapse
-
.from_s(str) ⇒ Object
Convert string to boolean and return.
Instance Method Summary collapse
-
#initialize(val = false) ⇒ Boolean
constructor
A new instance of Boolean.
- #nil? ⇒ Boolean
Constructor Details
#initialize(val = false) ⇒ Boolean
Returns a new instance of Boolean.
98 99 100 |
# File 'lib/rxsd/builtin_types.rb', line 98 def initialize(val=false) @val = val end |
Class Method Details
.from_s(str) ⇒ Object
Convert string to boolean and return
94 95 96 |
# File 'lib/rxsd/builtin_types.rb', line 94 def self.from_s(str) str.to_b end |