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.
- #sid ⇒ Object
-
#suid? ⇒ Boolean
True if security is ‘definer’.
- #to_h ⇒ Object
Methods inherited from Node
#dump, #dump_value, #guid, #inspect, #to_s, #to_yaml, #uid
Constructor Details
#initialize(schema, name, owner, security) ⇒ Function
Returns a new instance of Function.
541 542 543 544 545 546 547 548 549 550 |
# File 'lib/pg_meta/meta.rb', line 541 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
527 528 529 |
# File 'lib/pg_meta/meta.rb', line 527 def owner @owner end |
#security ⇒ Object (readonly)
Security (:definer or :invoker)
530 531 532 |
# File 'lib/pg_meta/meta.rb', line 530 def security @security end |
Instance Method Details
#function? ⇒ Boolean
True if this is a function
536 |
# File 'lib/pg_meta/meta.rb', line 536 def function?() true end |
#procedure? ⇒ Boolean
True if this is a procedure
539 |
# File 'lib/pg_meta/meta.rb', line 539 def procedure?() !function? end |
#sid ⇒ Object
519 520 521 |
# File 'lib/pg_meta/meta.rb', line 519 def sid() @sid ||= name end |
#suid? ⇒ Boolean
True if security is ‘definer’
533 |
# File 'lib/pg_meta/meta.rb', line 533 def suid?() security == 'definer' end |
#to_h ⇒ Object
552 |
# File 'lib/pg_meta/meta.rb', line 552 def to_h() attrs_to_h(:name, :owner, :security, :function?) end |