Class: PG::Tuple

Inherits:
Object show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/pg-1.4.5/lib/pg/tuple.rb

Instance Method Summary collapse

Instance Method Details

#each_key(&block) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/pg-1.4.5/lib/pg/tuple.rb', line 23

def each_key(&block)
  if fn=field_names
    fn.each(&block)
  else
    field_map.each_key(&block)
  end
end

#has_key?(key) ⇒ Boolean Also known as: key?

Returns:

  • (Boolean)


14
15
16
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/pg-1.4.5/lib/pg/tuple.rb', line 14

def has_key?(key)
  field_map.has_key?(key)
end

#inspectObject

Return a String representation of the object suitable for debugging.



10
11
12
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/pg-1.4.5/lib/pg/tuple.rb', line 10

def inspect
  "#<#{self.class} #{self.map{|k,v| "#{k}: #{v.inspect}" }.join(", ") }>"
end

#keysObject



19
20
21
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/pg-1.4.5/lib/pg/tuple.rb', line 19

def keys
  field_names || field_map.keys.freeze
end