Class: PLSQL::Variable::VariableProcedure

Inherits:
Object
  • Object
show all
Defined in:
lib/plsql/variable.rb

Overview

wrapper class to simulate Procedure class for ProcedureClass#exec

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(schema, variable, operation, metadata) ⇒ VariableProcedure

Returns a new instance of VariableProcedure.



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/plsql/variable.rb', line 101

def initialize(schema, variable, operation, )
  @schema = schema
  @variable = variable
  @operation = operation
  @metadata = 

  @out_list = [[]]

  case @operation
  when :get
    @argument_list = [[]]
    @arguments = [{}]
    @return = [@metadata]
  when :set
    @argument_list = [[:value]]
    @arguments = [{:value => @metadata}]
    @return = [nil]
  end

end

Instance Attribute Details

#argument_listObject (readonly)

:nodoc:



99
100
101
# File 'lib/plsql/variable.rb', line 99

def argument_list
  @argument_list
end

#argumentsObject (readonly)

:nodoc:



99
100
101
# File 'lib/plsql/variable.rb', line 99

def arguments
  @arguments
end

#out_listObject (readonly)

:nodoc:



99
100
101
# File 'lib/plsql/variable.rb', line 99

def out_list
  @out_list
end

#returnObject (readonly)

:nodoc:



99
100
101
# File 'lib/plsql/variable.rb', line 99

def return
  @return
end

#schemaObject (readonly)

:nodoc:



99
100
101
# File 'lib/plsql/variable.rb', line 99

def schema
  @schema
end

Instance Method Details

#call_sql(params_string) ⇒ Object



130
131
132
133
134
135
136
137
138
139
140
# File 'lib/plsql/variable.rb', line 130

def call_sql(params_string)
  sql = (schema_name = @variable.schema_name) ? "#{schema_name}." : ""
  sql << "#{@variable.package_name}.#{@variable.variable_name}"
  case @operation
  when :get
    # params string contains assignment to return variable
    "#{params_string} #{sql};\n"
  when :set
    "#{sql} := #{params_string};\n"
  end
end

#overloaded?Boolean

Returns:

  • (Boolean)


122
123
124
# File 'lib/plsql/variable.rb', line 122

def overloaded?
  false
end

#procedureObject



126
127
128
# File 'lib/plsql/variable.rb', line 126

def procedure
  nil
end