Class: Amazon::Associates::BrowseNode
- Defined in:
- lib/amazon-associates/types/browse_node.rb
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(id = nil, name = nil, parent = nil) ⇒ BrowseNode
constructor
A new instance of BrowseNode.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(id = nil, name = nil, parent = nil) ⇒ BrowseNode
Returns a new instance of BrowseNode.
18 19 20 21 22 |
# File 'lib/amazon-associates/types/browse_node.rb', line 18 def initialize(id = nil, name = nil, parent = nil) @id = id @name = name @parent = parent end |
Class Method Details
.find(browse_node_id, opts = {}) ⇒ Object
14 15 16 |
# File 'lib/amazon-associates/types/browse_node.rb', line 14 def self.find(browse_node_id, opts = {}) Amazon::Associates.browse_node_lookup(opts.merge(:browse_node_id => browse_node_id)).browse_nodes.first end |
Instance Method Details
#==(other) ⇒ Object
32 33 34 35 |
# File 'lib/amazon-associates/types/browse_node.rb', line 32 def ==(other) return false unless other.respond_to?(:name, :id) @name == other.name and @id == other.id end |
#inspect ⇒ Object
28 29 30 |
# File 'lib/amazon-associates/types/browse_node.rb', line 28 def inspect "#<#{self.class}:#{@id} #{self}>" end |
#to_s ⇒ Object
24 25 26 |
# File 'lib/amazon-associates/types/browse_node.rb', line 24 def to_s "#{@name}#{' : ' + @parent.to_s if @parent}" end |