Class: Oembedder::ConsumerRequest
- Inherits:
-
Object
- Object
- Oembedder::ConsumerRequest
- Defined in:
- lib/oembedder/consumer_request.rb
Instance Attribute Summary collapse
-
#format ⇒ Object
Returns the value of attribute format.
-
#maxheight ⇒ Object
Returns the value of attribute maxheight.
-
#maxwidth ⇒ Object
Returns the value of attribute maxwidth.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(url, params = {}) ⇒ ConsumerRequest
constructor
A new instance of ConsumerRequest.
- #urlparams ⇒ Object
Constructor Details
#initialize(url, params = {}) ⇒ ConsumerRequest
Returns a new instance of ConsumerRequest.
6 7 8 9 10 11 |
# File 'lib/oembedder/consumer_request.rb', line 6 def initialize(url, params = {}) @url = url @maxwidth = params[:maxwidth] @maxheight = params[:maxheight] @format = params[:format] ||= :json # default is json end |
Instance Attribute Details
#format ⇒ Object
Returns the value of attribute format.
4 5 6 |
# File 'lib/oembedder/consumer_request.rb', line 4 def format @format end |
#maxheight ⇒ Object
Returns the value of attribute maxheight.
4 5 6 |
# File 'lib/oembedder/consumer_request.rb', line 4 def maxheight @maxheight end |
#maxwidth ⇒ Object
Returns the value of attribute maxwidth.
4 5 6 |
# File 'lib/oembedder/consumer_request.rb', line 4 def maxwidth @maxwidth end |
#url ⇒ Object
Returns the value of attribute url.
4 5 6 |
# File 'lib/oembedder/consumer_request.rb', line 4 def url @url end |
Instance Method Details
#urlparams ⇒ Object
13 14 15 16 17 18 |
# File 'lib/oembedder/consumer_request.rb', line 13 def urlparams param = "?url=#{self.url}" param += "&maxwidth=#{self.maxwidth}" if self.maxwidth param += "&maxheight=#{self.maxheight}" if self.maxheight param end |