Class: PGExaminer::Result::Table::Permission
- Defined in:
- lib/pg_examiner/result/table.rb
Constant Summary collapse
- CHARS_TO_LABELS =
{ "r" => "SELECT", # "read" "w" => "UPDATE", # "write" "a" => "INSERT", # "append" "d" => "DELETE", "D" => "TRUNCATE", "x" => "REFERENCES", "t" => "TRIGGER", }.freeze
Instance Attribute Summary collapse
-
#grantor ⇒ Object
Returns the value of attribute grantor.
-
#name ⇒ Object
Returns the value of attribute name.
-
#permissions ⇒ Object
Returns the value of attribute permissions.
Instance Method Summary collapse
- #diffable_methods ⇒ Object
-
#initialize(acl) ⇒ Permission
constructor
A new instance of Permission.
Methods inherited from Base
#==, #diff, #diffable_attrs, #diffable_lists
Constructor Details
#initialize(acl) ⇒ Permission
Returns a new instance of Permission.
71 72 73 74 75 |
# File 'lib/pg_examiner/result/table.rb', line 71 def initialize(acl) @name, = acl.split("=") , @grantor = .split("/") @permissions = .split("").map{|char| CHARS_TO_LABELS.fetch(char)} end |
Instance Attribute Details
#grantor ⇒ Object
Returns the value of attribute grantor.
59 60 61 |
# File 'lib/pg_examiner/result/table.rb', line 59 def grantor @grantor end |
#name ⇒ Object
Returns the value of attribute name.
59 60 61 |
# File 'lib/pg_examiner/result/table.rb', line 59 def name @name end |
#permissions ⇒ Object
Returns the value of attribute permissions.
59 60 61 |
# File 'lib/pg_examiner/result/table.rb', line 59 def @permissions end |
Instance Method Details
#diffable_methods ⇒ Object
77 78 79 80 81 82 |
# File 'lib/pg_examiner/result/table.rb', line 77 def diffable_methods { "grantor" => "grantor", "permissions" => "permissions", } end |