Class: Discogs::SearchResult
- Inherits:
-
Object
- Object
- Discogs::SearchResult
- Defined in:
- lib/search.rb
Instance Attribute Summary collapse
-
#summary ⇒ Object
Returns the value of attribute summary.
-
#title ⇒ Object
Returns the value of attribute title.
-
#type ⇒ Object
Returns the value of attribute type.
-
#uri ⇒ Object
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(type, title, uri, summary = nil) ⇒ SearchResult
constructor
A new instance of SearchResult.
-
#method_missing(method, *args, &block) ⇒ Object
:nodoc:.
-
#to_s ⇒ Object
:nodoc:.
Constructor Details
#initialize(type, title, uri, summary = nil) ⇒ SearchResult
Returns a new instance of SearchResult.
72 73 74 75 76 77 |
# File 'lib/search.rb', line 72 def initialize(type, title, uri, summary = nil) @type = type @title = title @uri = uri @summary = summary end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
:nodoc:
79 80 81 82 83 84 |
# File 'lib/search.rb', line 79 def method_missing(method, *args, &block) #:nodoc: type = method.to_s.match(/([a-zA-Z0-9_-]+)\?/) # if type.size < 2 the method did not have a question mark at the end super if type.size < 2 @type == type[1].to_s end |
Instance Attribute Details
#summary ⇒ Object
Returns the value of attribute summary.
67 68 69 |
# File 'lib/search.rb', line 67 def summary @summary end |
#title ⇒ Object
Returns the value of attribute title.
67 68 69 |
# File 'lib/search.rb', line 67 def title @title end |
#type ⇒ Object
Returns the value of attribute type.
67 68 69 |
# File 'lib/search.rb', line 67 def type @type end |
#uri ⇒ Object
Returns the value of attribute uri.
67 68 69 |
# File 'lib/search.rb', line 67 def uri @uri end |
Instance Method Details
#to_s ⇒ Object
:nodoc:
86 87 88 |
# File 'lib/search.rb', line 86 def to_s #:nodoc: "#{title}" end |