Class: GoogleApi::Shorten::Get

Inherits:
Url
  • Object
show all
Defined in:
lib/google_api/shorten/url/get.rb

Constant Summary collapse

PROJECTION_LIST =
['FULL', 'ANALYTICS_CLICKS', 'ANALYTICS_TOP_STRINGS']

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Url

#_session

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 : 
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



7
8
9
# File 'lib/google_api/shorten/url/get.rb', line 7

def data
  @data
end

#projectionObject (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_urlObject (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