Class: Gnip::Url
Constant Summary
Constants inherited from Message
Instance Attribute Summary collapse
-
#display_url ⇒ Object
readonly
Returns the value of attribute display_url.
-
#expanded_status ⇒ Object
readonly
Returns the value of attribute expanded_status.
-
#expanded_url ⇒ Object
readonly
Returns the value of attribute expanded_url.
-
#indices ⇒ Object
readonly
Returns the value of attribute indices.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Url
constructor
A new instance of Url.
- #original_attributes ⇒ Object
- #to_json ⇒ Object
Methods inherited from Message
#activity?, build, #error?, #generate_json, #info?, #system_message?, #warn?
Constructor Details
permalink #initialize(params = {}) ⇒ Url
Returns a new instance of Url.
5 6 7 8 9 10 11 |
# File 'lib/gnip_api/gnip/url.rb', line 5 def initialize params={} @url = params['url'] @expanded_url = params['expanded_url'] @display_url = params['display_url'] @expanded_status = params['expanded_status'] @indices = params['indices'] end |
Instance Attribute Details
permalink #display_url ⇒ Object (readonly)
Returns the value of attribute display_url.
3 4 5 |
# File 'lib/gnip_api/gnip/url.rb', line 3 def display_url @display_url end |
permalink #expanded_status ⇒ Object (readonly)
Returns the value of attribute expanded_status.
3 4 5 |
# File 'lib/gnip_api/gnip/url.rb', line 3 def @expanded_status end |
permalink #expanded_url ⇒ Object (readonly)
Returns the value of attribute expanded_url.
3 4 5 |
# File 'lib/gnip_api/gnip/url.rb', line 3 def @expanded_url end |
permalink #indices ⇒ Object (readonly)
Returns the value of attribute indices.
3 4 5 |
# File 'lib/gnip_api/gnip/url.rb', line 3 def indices @indices end |
permalink #url ⇒ Object (readonly)
Returns the value of attribute url.
3 4 5 |
# File 'lib/gnip_api/gnip/url.rb', line 3 def url @url end |
Instance Method Details
permalink #original_attributes ⇒ Object
[View source]
21 22 23 24 25 26 27 28 29 |
# File 'lib/gnip_api/gnip/url.rb', line 21 def original_attributes { :url => @url, :display_url => @display_url, :expanded_url => @expanded_url, :expanded_status => @expanded_status, :indices => @indices }.delete_if{|k,v| v.nil?} end |
permalink #to_json ⇒ Object
[View source]
31 32 33 |
# File 'lib/gnip_api/gnip/url.rb', line 31 def to_json generate_json(original_attributes) end |