Module: Mopidy
- Defined in:
- lib/mopidy.rb,
lib/mopidy/http.rb,
lib/mopidy/library.rb,
lib/mopidy/version.rb,
lib/mopidy/playback.rb,
lib/mopidy/playlist.rb,
lib/mopidy/response.rb,
lib/mopidy/tracklist.rb
Defined Under Namespace
Modules: Library, Playback, Playlist, Tracklist
Classes: Configuration, Http, Response
Constant Summary
collapse
- VERSION =
"0.2.0"
Class Attribute Summary collapse
Class Method Summary
collapse
Class Attribute Details
.configuration ⇒ Object
Returns the value of attribute configuration.
13
14
15
|
# File 'lib/mopidy.rb', line 13
def configuration
@configuration
end
|
Class Method Details
16
17
18
19
|
# File 'lib/mopidy.rb', line 16
def self.configure
self.configuration ||= Configuration.new
yield configuration
end
|
31
32
33
34
35
36
37
38
|
# File 'lib/mopidy.rb', line 31
def self.format_json(id, method, params = {})
{
'jsonrpc': '2.0',
'id': id,
'method': method,
'params': params
}.to_json
end
|
.post(body) ⇒ Object
40
41
42
43
|
# File 'lib/mopidy.rb', line 40
def self.post(body)
= { 'Content-Type' => 'application/json' }
res = Http.post(configuration.mopidy_url, body, )
end
|