Module: NicoAPI::Base

Included in:
GetThumbInfo, Mylist, TagSearch, VideoArray
Defined in:
lib/nicoapi/base.rb

Instance Method Summary collapse

Instance Method Details

#getObject



27
28
29
30
31
# File 'lib/nicoapi/base.rb', line 27

def get
  http_client = NicoAPI::HttpClient.instance
  http_client.set_params uri.to_s
  http_client.get
end

#paramsObject



10
11
12
# File 'lib/nicoapi/base.rb', line 10

def params
  @params_array.join('&')
end

#pathObject



14
15
16
17
18
19
20
# File 'lib/nicoapi/base.rb', line 14

def path
  if @dynamic_segment.present?
    static_segment + '/' + @dynamic_segment
  else
    static_segment
  end
end

#schemeObject



6
7
8
# File 'lib/nicoapi/base.rb', line 6

def scheme
  'http'
end

#uriObject



22
23
24
25
# File 'lib/nicoapi/base.rb', line 22

def uri
  _uri = scheme + "://" + [ ([host, path].join('/')), params].join('?')
  URI.escape _uri
end