Class: ActiveSalesforce::EntityDefinition
- Inherits:
-
Object
- Object
- ActiveSalesforce::EntityDefinition
- Defined in:
- lib/active_record/connection_adapters/entity_definition.rb
Instance Attribute Summary collapse
-
#api_name_to_column ⇒ Object
readonly
Returns the value of attribute api_name_to_column.
-
#asf_class ⇒ Object
readonly
Returns the value of attribute asf_class.
-
#column_name_to_column ⇒ Object
readonly
Returns the value of attribute column_name_to_column.
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#key_prefix ⇒ Object
readonly
Returns the value of attribute key_prefix.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#relationships ⇒ Object
readonly
Returns the value of attribute relationships.
Instance Method Summary collapse
- #api_name ⇒ Object
- #custom? ⇒ Boolean
-
#initialize(connection, name, asf_class, columns, relationships, custom, key_prefix) ⇒ EntityDefinition
constructor
A new instance of EntityDefinition.
- #layouts ⇒ Object
Constructor Details
#initialize(connection, name, asf_class, columns, relationships, custom, key_prefix) ⇒ EntityDefinition
Returns a new instance of EntityDefinition.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/active_record/connection_adapters/entity_definition.rb', line 25 def initialize(connection, name, asf_class, columns, relationships, custom, key_prefix) @connection = connection @name = name @asf_class = asf_class @columns = columns @relationships = relationships @custom = custom @key_prefix = key_prefix @column_name_to_column = {} @columns.each { |column| @column_name_to_column[column.name] = column } @api_name_to_column = {} @columns.each { |column| @api_name_to_column[column.api_name] = column } end |
Instance Attribute Details
#api_name_to_column ⇒ Object (readonly)
Returns the value of attribute api_name_to_column.
23 24 25 |
# File 'lib/active_record/connection_adapters/entity_definition.rb', line 23 def api_name_to_column @api_name_to_column end |
#asf_class ⇒ Object (readonly)
Returns the value of attribute asf_class.
23 24 25 |
# File 'lib/active_record/connection_adapters/entity_definition.rb', line 23 def asf_class @asf_class end |
#column_name_to_column ⇒ Object (readonly)
Returns the value of attribute column_name_to_column.
23 24 25 |
# File 'lib/active_record/connection_adapters/entity_definition.rb', line 23 def column_name_to_column @column_name_to_column end |
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
23 24 25 |
# File 'lib/active_record/connection_adapters/entity_definition.rb', line 23 def columns @columns end |
#key_prefix ⇒ Object (readonly)
Returns the value of attribute key_prefix.
23 24 25 |
# File 'lib/active_record/connection_adapters/entity_definition.rb', line 23 def key_prefix @key_prefix end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
23 24 25 |
# File 'lib/active_record/connection_adapters/entity_definition.rb', line 23 def name @name end |
#relationships ⇒ Object (readonly)
Returns the value of attribute relationships.
23 24 25 |
# File 'lib/active_record/connection_adapters/entity_definition.rb', line 23 def relationships @relationships end |
Instance Method Details
#api_name ⇒ Object
45 46 47 |
# File 'lib/active_record/connection_adapters/entity_definition.rb', line 45 def api_name @custom ? name + "__c" : name end |
#custom? ⇒ Boolean
41 42 43 |
# File 'lib/active_record/connection_adapters/entity_definition.rb', line 41 def custom? @custom end |
#layouts ⇒ Object
49 50 51 52 53 54 55 |
# File 'lib/active_record/connection_adapters/entity_definition.rb', line 49 def layouts return @layouts if @layouts # Lazy load Layout information response = @connection.binding.describeLayout(:sObjectType => api_name) @layouts = @connection.get_result(response, :describeLayout) end |