Class: Kovid::UriBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/kovid/uri_builder.rb

Constant Summary collapse

BASE_URI =
'corona.lmao.ninja'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path = '') ⇒ UriBuilder

Returns a new instance of UriBuilder.



11
12
13
# File 'lib/kovid/uri_builder.rb', line 11

def initialize(path = '')
  @path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



7
8
9
# File 'lib/kovid/uri_builder.rb', line 7

def path
  @path
end

Instance Method Details

#urlObject



15
16
17
# File 'lib/kovid/uri_builder.rb', line 15

def url
  URI::HTTPS.build(host: BASE_URI, path: path).to_s
end