Class: MODL::Model::ModlBoolNull

Inherits:
Object
  • Object
show all
Defined in:
lib/modl/model/model.rb

Overview

A MODL Boolean or NULL

Constant Summary collapse

MODL_NULL =
ModlBoolNull.new nil
MODL_TRUE =
ModlBoolNull.new true
MODL_FALSE =
ModlBoolNull.new false

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ ModlBoolNull

Returns a new instance of ModlBoolNull.



214
215
216
# File 'lib/modl/model/model.rb', line 214

def initialize(value)
  @value = value
end

Instance Method Details

#to_jObject



226
227
228
# File 'lib/modl/model/model.rb', line 226

def to_j
  @value
end

#to_mObject



230
231
232
# File 'lib/modl/model/model.rb', line 230

def to_m
  @value.nil? ? 'null' : @value
end

#to_sObject



222
223
224
# File 'lib/modl/model/model.rb', line 222

def to_s
  "ModlBoolNull: #{@value}"
end