Class: SkypeApi::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/skype_api/client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#auto_authorizeObject

Returns the value of attribute auto_authorize.



7
8
9
# File 'lib/skype_api/client.rb', line 7

def auto_authorize
  @auto_authorize
end

#fifoObject (readonly)

Returns the value of attribute fifo.



6
7
8
# File 'lib/skype_api/client.rb', line 6

def fifo
  @fifo
end

#loggerObject (readonly)

Returns the value of attribute logger.



6
7
8
# File 'lib/skype_api/client.rb', line 6

def logger
  @logger
end

#msg_listObject (readonly)

Returns the value of attribute msg_list.



6
7
8
# File 'lib/skype_api/client.rb', line 6

def msg_list
  @msg_list
end

#profileObject (readonly)

Returns the value of attribute profile.



6
7
8
# File 'lib/skype_api/client.rb', line 6

def profile
  @profile
end

#users_listObject (readonly)

Returns the value of attribute users_list.



6
7
8
# File 'lib/skype_api/client.rb', line 6

def users_list
  @users_list
end

Class Method Details

.instanceObject



9
10
11
# File 'lib/skype_api/client.rb', line 9

def self.instance
  @instance ||= new
end

Instance Method Details

#proxy(text) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/skype_api/client.rb', line 13

def proxy(text)
  @logger.info(">> #{text}")
  destination, target = text.split
  destination = destination.downcase.to_sym
  case destination
    when :currentuserhandle
      @profile = Profile.new(target)
      @fifo += @profile.fifo
    when :user
      user_redirect(target, text)
    when :chatmessage
      msg_redirect(target.to_i, text)
    when :profile
      profile_redirect(text)
  end
  @logger.info("<< #{fifo[0]}")
  # FIXME not for testing, only for Skype mode
  if ENV['_'].match(/rspec$/).nil?
    proxy(invoke_query[0])
  end
end