Class: GoogleApi::Shorten::Get
- Defined in:
- lib/google_api/shorten/url/get.rb
Constant Summary collapse
- PROJECTION_LIST =
['FULL', 'ANALYTICS_CLICKS', 'ANALYTICS_TOP_STRINGS']
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#projection ⇒ Object
readonly
Returns the value of attribute projection.
-
#short_url ⇒ Object
readonly
Returns the value of attribute short_url.
Instance Method Summary collapse
-
#initialize(short_url, projection) ⇒ Get
constructor
A new instance of Get.
Methods inherited from Url
Constructor Details
#initialize(short_url, projection) ⇒ Get
Returns a new instance of Get.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/google_api/shorten/url/get.rb', line 11 def initialize(short_url, projection) @short_url = short_url @projection = projection.upcase unless PROJECTION_LIST.include?(projection) raise GoogleApi::ShortenError, "Invalid projection. Must be #{PROJECTION_LIST.join(',')}." end @data = _session.check_session ? get : get_without_login end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
7 8 9 |
# File 'lib/google_api/shorten/url/get.rb', line 7 def data @data end |
#projection ⇒ Object (readonly)
Returns the value of attribute projection.
6 7 8 |
# File 'lib/google_api/shorten/url/get.rb', line 6 def projection @projection end |
#short_url ⇒ Object (readonly)
Returns the value of attribute short_url.
5 6 7 |
# File 'lib/google_api/shorten/url/get.rb', line 5 def short_url @short_url end |