Class: PGExaminer::Result
- Defined in:
- lib/pg_examiner/result.rb,
lib/pg_examiner/result/item.rb,
lib/pg_examiner/result/index.rb,
lib/pg_examiner/result/table.rb,
lib/pg_examiner/result/column.rb,
lib/pg_examiner/result/schema.rb,
lib/pg_examiner/result/trigger.rb,
lib/pg_examiner/result/function.rb,
lib/pg_examiner/result/language.rb,
lib/pg_examiner/result/sequence.rb,
lib/pg_examiner/result/extension.rb,
lib/pg_examiner/result/constraint.rb
Defined Under Namespace
Classes: Column, Constraint, Extension, Function, Index, Item, Language, Schema, Sequence, Table, Trigger
Instance Attribute Summary collapse
-
#pg_attrdef ⇒ Object
readonly
Returns the value of attribute pg_attrdef.
-
#pg_attribute ⇒ Object
readonly
Returns the value of attribute pg_attribute.
-
#pg_class ⇒ Object
readonly
Returns the value of attribute pg_class.
-
#pg_constraint ⇒ Object
readonly
Returns the value of attribute pg_constraint.
-
#pg_extension ⇒ Object
readonly
Returns the value of attribute pg_extension.
-
#pg_index ⇒ Object
readonly
Returns the value of attribute pg_index.
-
#pg_language ⇒ Object
readonly
Returns the value of attribute pg_language.
-
#pg_namespace ⇒ Object
readonly
Returns the value of attribute pg_namespace.
-
#pg_proc ⇒ Object
readonly
Returns the value of attribute pg_proc.
-
#pg_trigger ⇒ Object
readonly
Returns the value of attribute pg_trigger.
-
#pg_type ⇒ Object
readonly
Returns the value of attribute pg_type.
Instance Method Summary collapse
- #diffable_lists ⇒ Object
- #extensions ⇒ Object
-
#initialize(connection) ⇒ Result
constructor
A new instance of Result.
- #inspect ⇒ Object
- #languages ⇒ Object
- #schemas ⇒ Object
Methods inherited from Base
#==, #diff, #diffable_attrs, #diffable_methods
Constructor Details
#initialize(connection) ⇒ Result
Returns a new instance of Result.
19 20 21 22 |
# File 'lib/pg_examiner/result.rb', line 19 def initialize(connection) @conn = connection load_schema end |
Instance Attribute Details
#pg_attrdef ⇒ Object (readonly)
Returns the value of attribute pg_attrdef.
7 8 9 |
# File 'lib/pg_examiner/result.rb', line 7 def pg_attrdef @pg_attrdef end |
#pg_attribute ⇒ Object (readonly)
Returns the value of attribute pg_attribute.
7 8 9 |
# File 'lib/pg_examiner/result.rb', line 7 def pg_attribute @pg_attribute end |
#pg_class ⇒ Object (readonly)
Returns the value of attribute pg_class.
7 8 9 |
# File 'lib/pg_examiner/result.rb', line 7 def pg_class @pg_class end |
#pg_constraint ⇒ Object (readonly)
Returns the value of attribute pg_constraint.
7 8 9 |
# File 'lib/pg_examiner/result.rb', line 7 def pg_constraint @pg_constraint end |
#pg_extension ⇒ Object (readonly)
Returns the value of attribute pg_extension.
7 8 9 |
# File 'lib/pg_examiner/result.rb', line 7 def pg_extension @pg_extension end |
#pg_index ⇒ Object (readonly)
Returns the value of attribute pg_index.
7 8 9 |
# File 'lib/pg_examiner/result.rb', line 7 def pg_index @pg_index end |
#pg_language ⇒ Object (readonly)
Returns the value of attribute pg_language.
7 8 9 |
# File 'lib/pg_examiner/result.rb', line 7 def pg_language @pg_language end |
#pg_namespace ⇒ Object (readonly)
Returns the value of attribute pg_namespace.
7 8 9 |
# File 'lib/pg_examiner/result.rb', line 7 def pg_namespace @pg_namespace end |
#pg_proc ⇒ Object (readonly)
Returns the value of attribute pg_proc.
7 8 9 |
# File 'lib/pg_examiner/result.rb', line 7 def pg_proc @pg_proc end |
#pg_trigger ⇒ Object (readonly)
Returns the value of attribute pg_trigger.
7 8 9 |
# File 'lib/pg_examiner/result.rb', line 7 def pg_trigger @pg_trigger end |
#pg_type ⇒ Object (readonly)
Returns the value of attribute pg_type.
7 8 9 |
# File 'lib/pg_examiner/result.rb', line 7 def pg_type @pg_type end |
Instance Method Details
#diffable_lists ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/pg_examiner/result.rb', line 24 def diffable_lists { "schemas" => "schemas", "extensions" => "extensions", "languages" => "languages", } end |
#extensions ⇒ Object
36 37 38 |
# File 'lib/pg_examiner/result.rb', line 36 def extensions @extensions ||= @pg_extension.map{|row| Extension.new(self, row)}.sort_by(&:name) end |
#inspect ⇒ Object
44 45 46 |
# File 'lib/pg_examiner/result.rb', line 44 def inspect "#<#{self.class} @schemas=#{@schemas.inspect}, @extensions=#{@extensions.inspect}>" end |
#languages ⇒ Object
40 41 42 |
# File 'lib/pg_examiner/result.rb', line 40 def languages @languages ||= @pg_language.map{|row| Language.new(self, row)}.sort_by(&:name) end |
#schemas ⇒ Object
32 33 34 |
# File 'lib/pg_examiner/result.rb', line 32 def schemas @schemas ||= @pg_namespace.map{|row| Schema.new(self, row)}.sort_by(&:name) end |