Class: Shikimori::API::URI

Inherits:
Object
  • Object
show all
Defined in:
lib/shikimori/api/uri.rb

Overview

Helper to working with URI object

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri) ⇒ URI

Returns a new instance of URI.



9
10
11
# File 'lib/shikimori/api/uri.rb', line 9

def initialize(uri)
  @url = URI(uri.to_s)
end

Instance Attribute Details

#urlObject (readonly)

Returns the value of attribute url.



7
8
9
# File 'lib/shikimori/api/uri.rb', line 7

def url
  @url
end

Instance Method Details

#join(*path) ⇒ Object



13
14
15
# File 'lib/shikimori/api/uri.rb', line 13

def join(*path)
  self.class.new ::URI.join(@url, path.join('/'))
end