Class: SfCli::Sf::Data::Query::RegularResultAdjuster
- Inherits:
-
Object
- Object
- SfCli::Sf::Data::Query::RegularResultAdjuster
- Includes:
- HelperMethods
- Defined in:
- lib/sf_cli/sf/data/query_helper.rb
Instance Attribute Summary collapse
-
#model_class ⇒ Object
readonly
Returns the value of attribute model_class.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
- #get_return_value ⇒ Object
-
#initialize(result, model_class) ⇒ RegularResultAdjuster
constructor
A new instance of RegularResultAdjuster.
Methods included from HelperMethods
Constructor Details
#initialize(result, model_class) ⇒ RegularResultAdjuster
Returns a new instance of RegularResultAdjuster.
11 12 13 14 |
# File 'lib/sf_cli/sf/data/query_helper.rb', line 11 def initialize(result, model_class) @result = result @model_class = model_class end |
Instance Attribute Details
#model_class ⇒ Object (readonly)
Returns the value of attribute model_class.
9 10 11 |
# File 'lib/sf_cli/sf/data/query_helper.rb', line 9 def model_class @model_class end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
9 10 11 |
# File 'lib/sf_cli/sf/data/query_helper.rb', line 9 def result @result end |
Instance Method Details
#get_return_value ⇒ Object
16 17 18 19 20 21 |
# File 'lib/sf_cli/sf/data/query_helper.rb', line 16 def get_return_value result['result']['records'].each_with_object([]) do |h, a| record = prepare_record(h) a << (model_class ? model_class.new(**record) : record) end end |