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



262
263
264
265
266
267
268
# File 'lib/plsql/type.rb', line 262

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.



254
255
256
# File 'lib/plsql/type.rb', line 254

def plsql_type
  @plsql_type
end

Class Method Details

.create(type, attributes) ⇒ Object



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

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