Class: PgMeta::Function
Direct Known Subclasses
Instance Attribute Summary collapse
-
#owner ⇒ Object
readonly
Owner of the function.
-
#security ⇒ Object
readonly
Security (:definer or :invoker).
Attributes inherited from Node
Instance Method Summary collapse
-
#function? ⇒ Boolean
True if this is a function.
-
#initialize(schema, name, owner, security) ⇒ Function
constructor
A new instance of Function.
-
#procedure? ⇒ Boolean
True if this is a procedure.
-
#suid? ⇒ Boolean
True if security is ‘definer’.
- #to_h ⇒ Object
Methods inherited from Node
#dump, #dump_value, #guid, #inspect, #to_yaml, #uid
Constructor Details
#initialize(schema, name, owner, security) ⇒ Function
Returns a new instance of Function.
516 517 518 519 520 521 522 523 524 525 |
# File 'lib/pg_meta/meta.rb', line 516 def initialize(schema, name, owner, security) super(schema, name) @owner = owner @security = security.to_sym if function? schema.functions[name] = self else schema.procedures[name] = self end end |
Instance Attribute Details
#owner ⇒ Object (readonly)
Owner of the function
502 503 504 |
# File 'lib/pg_meta/meta.rb', line 502 def owner @owner end |
#security ⇒ Object (readonly)
Security (:definer or :invoker)
505 506 507 |
# File 'lib/pg_meta/meta.rb', line 505 def security @security end |
Instance Method Details
#function? ⇒ Boolean
True if this is a function
511 |
# File 'lib/pg_meta/meta.rb', line 511 def function?() true end |
#procedure? ⇒ Boolean
True if this is a procedure
514 |
# File 'lib/pg_meta/meta.rb', line 514 def procedure?() !function? end |
#suid? ⇒ Boolean
True if security is ‘definer’
508 |
# File 'lib/pg_meta/meta.rb', line 508 def suid?() security == 'definer' end |
#to_h ⇒ Object
527 |
# File 'lib/pg_meta/meta.rb', line 527 def to_h() attrs_to_h(:name, :owner, :security, :function?) end |