Class: Freesound::Client::Response::Base
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Freesound::Client::Response::Base
show all
- Defined in:
- lib/freesound/client.rb
Instance Method Summary
collapse
Constructor Details
#initialize(response, http) ⇒ Base
Returns a new instance of Base.
79
80
81
82
|
# File 'lib/freesound/client.rb', line 79
def initialize(response, http)
super(response)
@http = http
end
|
Instance Method Details
#data ⇒ Object
84
85
86
|
# File 'lib/freesound/client.rb', line 84
def data
@data ||= parse
end
|
#follow_link(name, into_class, **params) ⇒ Object
88
89
90
91
92
93
94
|
# File 'lib/freesound/client.rb', line 88
def follow_link(name, into_class, **params)
if url = data[name.to_s]
into_class.new(@http.get(url, params: params), @http)
else
nil
end
end
|