Class: Yourls::Url

Inherits:
Object
  • Object
show all
Defined in:
lib/yourls/url.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Url

Returns a new instance of Url



5
6
7
8
9
10
11
12
# File 'lib/yourls/url.rb', line 5

def initialize(options = {})
  if options
    url = options['url'] || Hash.new('')
    @short_url = options['shorturl']
    @long_url = options['longurl'] || url['url']
    @keyword = options['keyword'] || url['keyword']
  end
end

Instance Attribute Details

#keywordObject (readonly)

Returns the value of attribute keyword



3
4
5
# File 'lib/yourls/url.rb', line 3

def keyword
  @keyword
end

#long_urlObject (readonly)

Returns the value of attribute long_url



3
4
5
# File 'lib/yourls/url.rb', line 3

def long_url
  @long_url
end

#short_urlObject (readonly)

Returns the value of attribute short_url



3
4
5
# File 'lib/yourls/url.rb', line 3

def short_url
  @short_url
end