Class: ActiveForce::SelectBuilder
- Inherits:
-
Object
- Object
- ActiveForce::SelectBuilder
- Defined in:
- lib/active_force/select_builder.rb
Instance Attribute Summary collapse
-
#nested_query_fields ⇒ Object
readonly
Returns the value of attribute nested_query_fields.
-
#non_nested_query_fields ⇒ Object
readonly
Returns the value of attribute non_nested_query_fields.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
-
#selected_fields ⇒ Object
readonly
Returns the value of attribute selected_fields.
Instance Method Summary collapse
-
#initialize(selected_fields, query) ⇒ SelectBuilder
constructor
A new instance of SelectBuilder.
- #parse ⇒ Object
Constructor Details
#initialize(selected_fields, query) ⇒ SelectBuilder
Returns a new instance of SelectBuilder.
6 7 8 9 10 11 |
# File 'lib/active_force/select_builder.rb', line 6 def initialize(selected_fields, query) @query = query @selected_fields = selected_fields @non_nested_query_fields = [] @nested_query_fields = [] end |
Instance Attribute Details
#nested_query_fields ⇒ Object (readonly)
Returns the value of attribute nested_query_fields.
4 5 6 |
# File 'lib/active_force/select_builder.rb', line 4 def nested_query_fields @nested_query_fields end |
#non_nested_query_fields ⇒ Object (readonly)
Returns the value of attribute non_nested_query_fields.
4 5 6 |
# File 'lib/active_force/select_builder.rb', line 4 def non_nested_query_fields @non_nested_query_fields end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
4 5 6 |
# File 'lib/active_force/select_builder.rb', line 4 def query @query end |
#selected_fields ⇒ Object (readonly)
Returns the value of attribute selected_fields.
4 5 6 |
# File 'lib/active_force/select_builder.rb', line 4 def selected_fields @selected_fields end |
Instance Method Details
#parse ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/active_force/select_builder.rb', line 13 def parse selected_fields.each do |field| case field when Symbol non_nested_query_fields << query.mappings[field] when Hash populate_nested_query_fields(field) when String non_nested_query_fields << field end end {non_nested_query_fields: non_nested_query_fields, nested_query_fields: nested_query_fields} end |