Class: GitHub::SQL::Literal

Inherits:
Object
  • Object
show all
Defined in:
lib/github/sql/literal.rb

Overview

Internal: a SQL literal value.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Literal

Returns a new instance of Literal.



8
9
10
# File 'lib/github/sql/literal.rb', line 8

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

Instance Attribute Details

#valueObject (readonly)

Public: the string value of this literal



6
7
8
# File 'lib/github/sql/literal.rb', line 6

def value
  @value
end

Instance Method Details

#bytesizeObject



16
17
18
# File 'lib/github/sql/literal.rb', line 16

def bytesize
  value.bytesize
end

#inspectObject



12
13
14
# File 'lib/github/sql/literal.rb', line 12

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