Class: WiMP::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/wimp/base.rb

Direct Known Subclasses

Playlist, Track

Constant Summary collapse

@@transport =
Thrift::HTTPClientTransport.new("http://client.wimpmusic.com/clientapi/service")
@@protocol =
Thrift::BinaryProtocol.new(@@transport)
@@client =
Gen::ClientApiService::Client.new(@@protocol)

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(orginal) ⇒ Base

Returns a new instance of Base.



7
8
9
# File 'lib/wimp/base.rb', line 7

def initialize(orginal)
  @o = orginal
end

Class Method Details

.execute(&block) ⇒ Object



11
12
13
14
15
16
# File 'lib/wimp/base.rb', line 11

def self.execute(&block)
  @@transport.open
  result = block.call(@@client)
  @@transport.close
  result
end

.sessionObject



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

def self.session
  WiMP.configuration.session
end

Instance Method Details

#execute(&block) ⇒ Object



18
19
20
# File 'lib/wimp/base.rb', line 18

def execute(&block)
  Base.execute(&block)
end

#sessionObject



26
27
28
# File 'lib/wimp/base.rb', line 26

def session
  WiMP.configuration.session
end