Class: SfCli::Sf::Model::Generator
- Inherits:
-
Object
- Object
- SfCli::Sf::Model::Generator
- Defined in:
- lib/sf_cli/sf/model/generator.rb
Instance Attribute Summary collapse
-
#sf_sobject ⇒ Object
readonly
Returns the value of attribute sf_sobject.
-
#target_org ⇒ Object
readonly
Returns the value of attribute target_org.
Instance Method Summary collapse
- #describe(object_name) ⇒ Object
- #generate(object_name) ⇒ Object
-
#initialize(target_org: nil) ⇒ Generator
constructor
A new instance of Generator.
Constructor Details
Instance Attribute Details
#sf_sobject ⇒ Object (readonly)
Returns the value of attribute sf_sobject.
8 9 10 |
# File 'lib/sf_cli/sf/model/generator.rb', line 8 def sf_sobject @sf_sobject end |
#target_org ⇒ Object (readonly)
Returns the value of attribute target_org.
8 9 10 |
# File 'lib/sf_cli/sf/model/generator.rb', line 8 def target_org @target_org end |
Instance Method Details
#describe(object_name) ⇒ Object
21 22 23 |
# File 'lib/sf_cli/sf/model/generator.rb', line 21 def describe(object_name) sf_sobject.describe object_name, target_org: target_org end |
#generate(object_name) ⇒ Object
15 16 17 18 19 |
# File 'lib/sf_cli/sf/model/generator.rb', line 15 def generate(object_name) class_definition = ClassDefinition.new(describe object_name) instance_eval "::#{object_name} = #{class_definition}" end |