Class: Oraora::Meta::Subprogram

Inherits:
Object
  • Object
show all
Defined in:
lib/oraora/meta/subprogram.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(schema, package, name) ⇒ Subprogram

Returns a new instance of Subprogram.



6
7
8
9
10
# File 'lib/oraora/meta/subprogram.rb', line 6

def initialize(schema, package, name)
  @schema = schema
  @package = package
  @name = name
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/oraora/meta/subprogram.rb', line 4

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/oraora/meta/subprogram.rb', line 4

def name
  @name
end

#packageObject (readonly)

Returns the value of attribute package.



4
5
6
# File 'lib/oraora/meta/subprogram.rb', line 4

def package
  @package
end

#schemaObject (readonly)

Returns the value of attribute schema.



4
5
6
# File 'lib/oraora/meta/subprogram.rb', line 4

def schema
  @schema
end

Class Method Details

.from_oci(oci, schema, package, name) ⇒ Object



18
19
20
# File 'lib/oraora/meta/subprogram.rb', line 18

def self.from_oci(oci, schema, package, name)
  new(schema, package, name).load_from_oci(oci)
end

Instance Method Details

#describe(options = {}) ⇒ Object



22
23
24
25
26
27
28
29
# File 'lib/oraora/meta/subprogram.rb', line 22

def describe(options = {})
  "    Schema:       \#{@schema}\n    Package:      \#{@package}\n    Name:         \#{@name}\n    Id:           \#{@id}\n  HERE\nend\n".reset_indentation

#list(options = {}, filter = nil) ⇒ Object

Raises:



31
32
33
# File 'lib/oraora/meta/subprogram.rb', line 31

def list(options = {}, filter = nil)
  raise NotApplicable, "Nothing to list for subprogram"
end

#load_from_oci(oci) ⇒ Object



12
13
14
15
16
# File 'lib/oraora/meta/subprogram.rb', line 12

def load_from_oci(oci)
  @id =
      oci.select_one("SELECT subprogram_id FROM all_procedues WHERE owner = :schema AND object_name = :package AND procedure_name = :name", @schema, @package, @name)
  self
end