Class: Alexa::UrlInfo::Categories
- Inherits:
-
Object
- Object
- Alexa::UrlInfo::Categories
- Includes:
- Container
- Defined in:
- lib/alexa/url_info/categories.rb
Instance Attribute Summary
Attributes included from Container
Instance Method Summary collapse
-
#initialize(xml_node = nil) ⇒ Categories
constructor
A new instance of Categories.
Methods included from Container
included, #keys, #method_missing, #to_mongo
Constructor Details
#initialize(xml_node = nil) ⇒ Categories
Returns a new instance of Categories.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/alexa/url_info/categories.rb', line 6 def initialize(xml_node = nil) @data = {} @data[:categories] = [] if xml_node != nil xml_node.xpath('CategoryData').each do |c| @data[:categories] << { :title => c.xpath('Title').text.strip, :absolute_path => c.xpath('AbsolutePath').text.strip, } end end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Alexa::Container