Sha256: ec37dc3cae4103bf364013cd24590ab9520f8edb77c821357bf4abfa3bbdf9b6

Contents?: true

Size: 674 Bytes

Versions: 1

Compression:

Stored size: 674 Bytes

Contents

require "logger"
require "terrestrial/public_conveniencies"

module Terrestrial
  # TODO: whoa! wtf is this? why did i?
  extend PublicConveniencies

  LOGGER = Logger.new(STDERR)

  class DatabaseID
    def initialize(val = nil)
      @value = val
    end

    def sql_literal(_dataset)
      @value.nil? ? "NULL" : @value.to_s
    end

    def nil?
      @value.nil?
    end

    def value=(v)
      @value = v
    end

    def to_s
      inspect
    end

    def inspect
      "#<%{class_name}>:0x%{hex_object_id} @value=%{value}>" % {
        class_name: self.class.name,
        hex_object_id: object_id.<<(1).to_s(16),
        value: @value,
      }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
terrestrial-0.5.0 lib/terrestrial.rb