Class: SfConnect::Define
- Inherits:
-
Object
- Object
- SfConnect::Define
- Defined in:
- lib/sf_connect/define.rb
Overview
define to salesforce connective module
Instance Attribute Summary collapse
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#salesforce_object_name ⇒ Object
readonly
Returns the value of attribute salesforce_object_name.
Instance Method Summary collapse
- #call ⇒ Object
- #generate_binding ⇒ Object
-
#initialize(salesforce_object_name, fields:, where: nil, &block) ⇒ Define
constructor
A new instance of Define.
Constructor Details
#initialize(salesforce_object_name, fields:, where: nil, &block) ⇒ Define
Returns a new instance of Define.
8 9 10 11 12 13 14 |
# File 'lib/sf_connect/define.rb', line 8 def initialize(salesforce_object_name, fields:, where: nil, &block) @salesforce_object_name = salesforce_object_name @define = generate_binding @define.include(SfConnect::Downloader) @define.include(SfConnect::Uploader) @fields = SfConnect::Fields.new(fields:, where:, salesforce_object_name:, block:) end |
Instance Attribute Details
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
6 7 8 |
# File 'lib/sf_connect/define.rb', line 6 def fields @fields end |
#salesforce_object_name ⇒ Object (readonly)
Returns the value of attribute salesforce_object_name.
6 7 8 |
# File 'lib/sf_connect/define.rb', line 6 def salesforce_object_name @salesforce_object_name end |
Instance Method Details
#call ⇒ Object
16 17 18 |
# File 'lib/sf_connect/define.rb', line 16 def call @define end |
#generate_binding ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/sf_connect/define.rb', line 20 def generate_binding define = self Module.new do extend ActiveSupport::Concern class_methods do define_method(:salesforce_object_name) { define.salesforce_object_name } define_method(:salesforce_fields) { define.fields } end end end |