Class: MDEXClient::MData::NavigationResult
- Defined in:
- lib/mdex_client/mdata/navigation_result.rb
Instance Attribute Summary collapse
-
#analytics ⇒ Object
Returns the value of attribute analytics.
-
#business_rules ⇒ Object
Returns the value of attribute business_rules.
-
#dimension_values ⇒ Object
Returns the value of attribute dimension_values.
-
#dimensions ⇒ Object
Returns the value of attribute dimensions.
-
#eql_expression ⇒ Object
Returns the value of attribute eql_expression.
-
#keyword_redirects ⇒ Object
Returns the value of attribute keyword_redirects.
-
#language_id ⇒ Object
Returns the value of attribute language_id.
-
#offset ⇒ Object
Returns the value of attribute offset.
-
#range_filters ⇒ Object
Returns the value of attribute range_filters.
-
#record_filter ⇒ Object
Returns the value of attribute record_filter.
-
#records ⇒ Object
Returns the value of attribute records.
-
#records_per_page ⇒ Object
Returns the value of attribute records_per_page.
-
#refinement_configs ⇒ Object
Returns the value of attribute refinement_configs.
-
#search_reports ⇒ Object
Returns the value of attribute search_reports.
-
#selected_dimension_value_ids ⇒ Object
Returns the value of attribute selected_dimension_value_ids.
-
#total_aggregate_record_count ⇒ Object
Returns the value of attribute total_aggregate_record_count.
-
#total_record_count ⇒ Object
Returns the value of attribute total_record_count.
Attributes inherited from Node
Instance Method Summary collapse
- #add_dimension_values!(values) ⇒ Object
- #expose_all_refinements? ⇒ Boolean
- #initialize_from_element! ⇒ Object
Methods inherited from Node
#css, #dimension_value_state_list, #initialize, #property_list, #record_list, #xpath
Constructor Details
This class inherits a constructor from MDEXClient::MData::Node
Instance Attribute Details
#analytics ⇒ Object
Returns the value of attribute analytics.
10 11 12 |
# File 'lib/mdex_client/mdata/navigation_result.rb', line 10 def analytics @analytics end |
#business_rules ⇒ Object
Returns the value of attribute business_rules.
10 11 12 |
# File 'lib/mdex_client/mdata/navigation_result.rb', line 10 def business_rules @business_rules end |
#dimension_values ⇒ Object
Returns the value of attribute dimension_values.
10 11 12 |
# File 'lib/mdex_client/mdata/navigation_result.rb', line 10 def dimension_values @dimension_values end |
#dimensions ⇒ Object
Returns the value of attribute dimensions.
10 11 12 |
# File 'lib/mdex_client/mdata/navigation_result.rb', line 10 def dimensions @dimensions end |
#eql_expression ⇒ Object
Returns the value of attribute eql_expression.
10 11 12 |
# File 'lib/mdex_client/mdata/navigation_result.rb', line 10 def eql_expression @eql_expression end |
#keyword_redirects ⇒ Object
Returns the value of attribute keyword_redirects.
10 11 12 |
# File 'lib/mdex_client/mdata/navigation_result.rb', line 10 def keyword_redirects @keyword_redirects end |
#language_id ⇒ Object
Returns the value of attribute language_id.
10 11 12 |
# File 'lib/mdex_client/mdata/navigation_result.rb', line 10 def language_id @language_id end |
#offset ⇒ Object
Returns the value of attribute offset.
10 11 12 |
# File 'lib/mdex_client/mdata/navigation_result.rb', line 10 def offset @offset end |
#range_filters ⇒ Object
Returns the value of attribute range_filters.
10 11 12 |
# File 'lib/mdex_client/mdata/navigation_result.rb', line 10 def range_filters @range_filters end |
#record_filter ⇒ Object
Returns the value of attribute record_filter.
10 11 12 |
# File 'lib/mdex_client/mdata/navigation_result.rb', line 10 def record_filter @record_filter end |
#records ⇒ Object
Returns the value of attribute records.
10 11 12 |
# File 'lib/mdex_client/mdata/navigation_result.rb', line 10 def records @records end |
#records_per_page ⇒ Object
Returns the value of attribute records_per_page.
10 11 12 |
# File 'lib/mdex_client/mdata/navigation_result.rb', line 10 def records_per_page @records_per_page end |
#refinement_configs ⇒ Object
Returns the value of attribute refinement_configs.
10 11 12 |
# File 'lib/mdex_client/mdata/navigation_result.rb', line 10 def refinement_configs @refinement_configs end |
#search_reports ⇒ Object
Returns the value of attribute search_reports.
10 11 12 |
# File 'lib/mdex_client/mdata/navigation_result.rb', line 10 def search_reports @search_reports end |
#selected_dimension_value_ids ⇒ Object
Returns the value of attribute selected_dimension_value_ids.
10 11 12 |
# File 'lib/mdex_client/mdata/navigation_result.rb', line 10 def selected_dimension_value_ids @selected_dimension_value_ids end |
#total_aggregate_record_count ⇒ Object
Returns the value of attribute total_aggregate_record_count.
10 11 12 |
# File 'lib/mdex_client/mdata/navigation_result.rb', line 10 def total_aggregate_record_count @total_aggregate_record_count end |
#total_record_count ⇒ Object
Returns the value of attribute total_record_count.
10 11 12 |
# File 'lib/mdex_client/mdata/navigation_result.rb', line 10 def total_record_count @total_record_count end |
Instance Method Details
#add_dimension_values!(values) ⇒ Object
62 63 64 65 66 67 68 |
# File 'lib/mdex_client/mdata/navigation_result.rb', line 62 def add_dimension_values!(values) values.each do |id, value| next if @dimension_values[id] @dimension_values[id] = value add_dimension_values!(value.values) end end |
#expose_all_refinements? ⇒ Boolean
70 71 72 |
# File 'lib/mdex_client/mdata/navigation_result.rb', line 70 def expose_all_refinements? @expose_all_refinements end |
#initialize_from_element! ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/mdex_client/mdata/navigation_result.rb', line 16 def initialize_from_element! @dimensions = {} @dimension_values = {} xpath("mdata:Dimensions/mdata:Dimension").each do |child| dim = Dimension.new(child) @dimensions[dim.id.to_i] = dim add_dimension_values!(dim.values) end xpath("mdata:NavigationStatesResult/mdata:DimensionStates/mdata:DimensionState").each do |child| dim = @dimensions[child["DimensionId"].to_i] dim.initialize_dimension_state!(child, @dimension_values) end refinement_configs = xpath("mdata:NavigationStatesResult/mdata:RefinementConfigs").first @expose_all_refinements = (refinement_configs["ExposeAllRefinements"] == "true") if refinement_configs @refinement_configs = xpath("mdata:NavigationStatesResult/mdata:RefinementConfigs/mdata:RefinementConfig").collect do |child| RefinementConfig.new(child) end records_result = xpath("mdata:RecordsResult").first @offset = records_result["Offset"].to_i @records_per_page = records_result["RecordsPerPage"].to_i @total_record_count = records_result["TotalRecordCount"].to_i @total_aggregate_record_count = records_result["TotalAggregateRecordCount"].to_i @records = record_list("mdata:RecordsResult/mdata:Records") applied_filters = xpath("mdata:NavigationAppliedFilters") if applied_filters.count > 0 af = Node.new(applied_filters.first) @eql_expression = af.xpath("mdata:EqlExpression").text @record_filter = af.xpath("mdata:RecordFilter").text #TODO: search reports @selected_dimension_value_ids = af.xpath("mdata:SelectedDimensionValueIds/mdata:DimensionValueId").collect(&:to_i) @language_id = af.xpath("mdata:LanguageId").text end @range_filters = xpath("mdata:NavigationAppliedFilters/mdata:RangeFilterList").children.collect do |filter| RangeFilter.from_element(filter) end #TODO: business rules #TODO: keyword redirects #TODO: analytics end |