class Mida::DataType::Boolean

Boolean data type Provides access to TrueClass/FalseClass methods

Public Class Methods

new(value) click to toggle source

Raises ArgumentError if value not valid boolean

# File lib/mida_vocabulary/datatype/boolean.rb, line 11
def initialize(value)
  @parsedValue = case value.downcase
                 when 'true' then true
                 when 'false' then false
                 else raise ::ArgumentError, 'Invalid value'
                 end
end

Public Instance Methods

to_s() click to toggle source
# File lib/mida_vocabulary/datatype/boolean.rb, line 19
def to_s
  @parsedValue.to_s.capitalize
end