Sha256: 6976bc82910ce7c9a88003c13c9a44d9d3c867cc909dcd2c67d0b2cf9ff34fd0

Contents?: true

Size: 477 Bytes

Versions: 10

Compression:

Stored size: 477 Bytes

Contents

module GitHub
  class SQL
    # Internal: a SQL literal value.
    class Literal
      # Public: the string value of this literal
      attr_reader :value

      def initialize(value)
        @value = value.to_s.dup.freeze
      end

      def inspect
        "<#{self.class.name} #{value}>"
      end

      def bytesize
        value.bytesize
      end
    end

    # Public: prepackaged literal values.
    NULL = Literal.new "NULL"
    NOW  = Literal.new "NOW()"
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
github-ds-0.5.4 lib/github/sql/literal.rb
github-ds-0.5.3 lib/github/sql/literal.rb
github-ds-0.5.2 lib/github/sql/literal.rb
github-ds-0.5.0 lib/github/sql/literal.rb
github-ds-0.4.0 lib/github/sql/literal.rb
github-ds-0.3.0 lib/github/sql/literal.rb
github-ds-0.2.11 lib/github/sql/literal.rb
github-ds-0.2.10 lib/github/sql/literal.rb
github-ds-0.2.9 lib/github/sql/literal.rb
github-ds-0.2.8 lib/github/sql/literal.rb