Class: EndecaOnDemand::Response

Inherits:
Proxy
  • Object
show all
Includes:
PP
Defined in:
lib/endeca_on_demand/response.rb,
lib/endeca_on_demand/response/property.rb,
lib/endeca_on_demand/response/dimension.rb,
lib/endeca_on_demand/response/breadcrumb.rb,
lib/endeca_on_demand/response/records_set.rb,
lib/endeca_on_demand/response/applied_filters.rb,
lib/endeca_on_demand/response/breadcrumb/bread.rb,
lib/endeca_on_demand/response/keyword_redirect.rb,
lib/endeca_on_demand/response/records_set/record.rb,
lib/endeca_on_demand/response/business_rules_result.rb,
lib/endeca_on_demand/response/dimension/dimension_value.rb,
lib/endeca_on_demand/response/applied_filters/search_report.rb,
lib/endeca_on_demand/response/business_rules_result/business_rule.rb,
lib/endeca_on_demand/response/applied_filters/search_report/search.rb,
lib/endeca_on_demand/response/applied_filters/selected_dimension_value_id.rb

Defined Under Namespace

Classes: AppliedFilters, Breadcrumb, BusinessRulesResult, Dimension, KeywordRedirect, Property, RecordsSet

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from PP

#inspect, #pretty_print

Methods inherited from Proxy

#inspect

Constructor Details

#initialize(query, result) ⇒ Response

Returns a new instance of Response


11
12
13
# File 'lib/endeca_on_demand/response.rb', line 11

def initialize(query, result)
  @query, @result = query, result
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class EndecaOnDemand::Proxy

Instance Attribute Details

#errorsObject (readonly)

fields ##


9
10
11
# File 'lib/endeca_on_demand/response.rb', line 9

def errors
  @errors
end

#queryObject (readonly)

fields ##


9
10
11
# File 'lib/endeca_on_demand/response.rb', line 9

def query
  @query
end

#resultObject (readonly)

fields ##


9
10
11
# File 'lib/endeca_on_demand/response.rb', line 9

def result
  @result
end

#xmlObject (readonly)

data ##


9
10
11
# File 'lib/endeca_on_demand/response.rb', line 9

def xml
  @xml
end

Instance Method Details

#applied_filtersObject


41
42
43
# File 'lib/endeca_on_demand/response.rb', line 41

def applied_filters
  @applied_filters ||= EndecaOnDemand::Response::AppliedFilters.new(self, xml.root.children.css('AppliedFilters'))
end

29
30
31
# File 'lib/endeca_on_demand/response.rb', line 29

def breadcrumbs
  @breadcrumbs ||= EndecaOnDemand::Collection.new(EndecaOnDemand::Response::Breadcrumb, xml.root.children.css('Breadcrumbs > Breads'), self)
end

#business_rules_resultObject


37
38
39
# File 'lib/endeca_on_demand/response.rb', line 37

def business_rules_result
  @business_rules_result ||= EndecaOnDemand::Response::BusinessRulesResult.new(self, xml.root.children.css('BusinessRulesResult > BusinessRules'))
end

#classObject

override proxy ##


17
18
19
# File 'lib/endeca_on_demand/response.rb', line 17

def class
  EndecaOnDemand::Response
end

#dimensionsObject


33
34
35
# File 'lib/endeca_on_demand/response.rb', line 33

def dimensions
  @dimensions ||= EndecaOnDemand::Collection.new(EndecaOnDemand::Response::Dimension, xml.root.children.css('Dimensions > Dimension'), self)
end

#inspect_attributesObject


6
# File 'lib/endeca_on_demand/response.rb', line 6

def inspect_attributes; [ :applied_filters, :breadcrumbs, :business_rules_result, :dimensions, :keyword_redirects, :records_set ]; end

#keyword_redirectsObject


45
46
47
# File 'lib/endeca_on_demand/response.rb', line 45

def keyword_redirects
  @keyword_redirects ||= EndecaOnDemand::Collection.new(EndecaOnDemand::Response::KeywordRedirect, xml.root.children.css('KeywordRedirects'), self)
end

#records_setObject

associations ##


25
26
27
# File 'lib/endeca_on_demand/response.rb', line 25

def records_set
  @records_set ||= EndecaOnDemand::Response::RecordsSet.new(self, xml.root.children.css('RecordsSet'))
end

#valid?Boolean

flags ##

Returns:

  • (Boolean)

61
62
63
# File 'lib/endeca_on_demand/response.rb', line 61

def valid?
  errors.blank?
end