Class: Ultron::URL

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, query) ⇒ URL

Returns a new instance of URL.



5
6
7
8
# File 'lib/ultron/url.rb', line 5

def initialize path, query
  @path  = path
  @query = query
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



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

def path
  @path
end

#queryObject (readonly)

Returns the value of attribute query.



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

def query
  @query
end

Instance Method Details

#==(other) ⇒ Object



14
15
16
# File 'lib/ultron/url.rb', line 14

def == other
  other.path == @path && other.query == @query
end

#to_sObject



10
11
12
# File 'lib/ultron/url.rb', line 10

def to_s
  "%s%s?%s%s" % [Ultron::Config.instance.root_url, @path, @query, Ultron.auth(ENV['PRIVATE_KEY'], ENV['PUBLIC_KEY'])]
end