Class: Fog::Associations::OracleOneIdentity

Inherits:
OracleDefault
  • Object
show all
Defined in:
lib/fog/oracle/models/associations.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from OracleDefault

#create_setter

Constructor Details

#initialize(model, name, collection_name, options) ⇒ OracleOneIdentity

Returns a new instance of OracleOneIdentity.



49
50
51
52
# File 'lib/fog/oracle/models/associations.rb', line 49

def initialize(model, name, collection_name, options)
  @details_name = options[:details_name]
  super(model, name, collection_name, options)
end

Instance Attribute Details

#details_nameObject (readonly)

Returns the value of attribute details_name.



47
48
49
# File 'lib/fog/oracle/models/associations.rb', line 47

def details_name
  @details_name
end

Instance Method Details

#create_getterObject



54
55
56
57
58
59
60
61
62
63
# File 'lib/fog/oracle/models/associations.rb', line 54

def create_getter
  super

  model.class_eval <<-EOS, __FILE__, __LINE__
    def #{details_name}
      return nil if associations[:#{name}].nil?
      service.send(self.class.associations[:#{name}]).get(associations[:#{name}])
    end
  EOS
end