Class: Avmtrf1::Oracle::Object

Inherits:
Object
  • Object
show all
Defined in:
lib/avmtrf1/oracle/object.rb,
lib/avmtrf1/oracle/object/base.rb,
lib/avmtrf1/oracle/object/user.rb,
lib/avmtrf1/oracle/object/view.rb,
lib/avmtrf1/oracle/object/table.rb

Defined Under Namespace

Classes: Base, Table, User, View

Class Method Summary collapse

Class Method Details

.factory_get(connection, attributes) ⇒ Object


11
12
13
14
15
# File 'lib/avmtrf1/oracle/object.rb', line 11

def factory_get(connection, attributes)
  return nil if attributes.blank?

  type_class(attributes.fetch(:type)).new(connection, attributes)
end

.type_class(type) ⇒ Object


17
18
19
20
21
# File 'lib/avmtrf1/oracle/object.rb', line 17

def type_class(type)
  const_get(type.to_s.humanize.camelize)
rescue NameError
  ::Avmtrf1::Oracle::Object::Base
end