Class: PLSQL::ObjectInstance

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

Overview

:nodoc:

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



265
266
267
268
269
270
271
# File 'lib/plsql/type.rb', line 265

def method_missing(method, *args, &block)
  if procedure = @plsql_type.find_procedure(method)
    procedure.exec_with_options(args, :self => self, &block)
  else
    raise ArgumentError, "No PL/SQL procedure '#{method.to_s.upcase}' found for type '#{@plsql_type.type_name}' object"
  end
end

Instance Attribute Details

#plsql_typeObject

Returns the value of attribute plsql_type.



257
258
259
# File 'lib/plsql/type.rb', line 257

def plsql_type
  @plsql_type
end

Class Method Details

.create(type, attributes) ⇒ Object



259
260
261
262
263
# File 'lib/plsql/type.rb', line 259

def self.create(type, attributes)
  object = self.new.merge!(attributes)
  object.plsql_type = type
  object
end