Class: Piggly::Dumper::QualifiedName

Inherits:
Object
  • Object
show all
Defined in:
lib/piggly/dumper/qualified_name.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(schema, name) ⇒ QualifiedName

Returns a new instance of QualifiedName.



7
8
9
# File 'lib/piggly/dumper/qualified_name.rb', line 7

def initialize(schema, name)
  @schema, @name = schema, name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/piggly/dumper/qualified_name.rb', line 5

def name
  @name
end

#schemaObject (readonly)

Returns the value of attribute schema.



5
6
7
# File 'lib/piggly/dumper/qualified_name.rb', line 5

def schema
  @schema
end

Instance Method Details

#==(other) ⇒ Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/piggly/dumper/qualified_name.rb', line 30

def ==(other)
  self.to_s == other.to_s
end

#quoteString

Returns:

  • (String)


12
13
14
15
16
17
18
# File 'lib/piggly/dumper/qualified_name.rb', line 12

def quote
  if @schema
    '"' + @schema + '"."' + @name + '"'
  else
    '"' + @name + '"'
  end
end

#to_sString

Returns:

  • (String)


21
22
23
24
25
26
27
# File 'lib/piggly/dumper/qualified_name.rb', line 21

def to_s
  if @schema
    @schema + "." + @name
  else
    @name
  end
end