RBase::Columns::LogicalColumn

Public Class Methods

new(name, options = {}) click to toggle source
# File lib/rbase/columns.rb, line 155
def initialize(name, options = {})
  super name, options.merge(:size => 1)
end

Public Instance Methods

inspect() click to toggle source
# File lib/rbase/columns.rb, line 178
def inspect
  "#{name}(boolean)"
end
pack(value) click to toggle source
# File lib/rbase/columns.rb, line 159
def pack(value)
  case value
  when true then 'T'
  when false then 'F'
  else '?'
  end
end
unpack(data) click to toggle source
# File lib/rbase/columns.rb, line 167
def unpack(data)
  case data.upcase
  when 'Y', 'T'
    true
  when 'N', 'F'
    false
  else
    nil
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.