Module: Fabriq::Skype

Defined in:
lib/fabriq/skype.rb,
lib/fabriq/skype/room.rb,
lib/fabriq/skype/message.rb

Defined Under Namespace

Classes: Message, Room

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.adapterObject

Returns the value of attribute adapter.



8
9
10
# File 'lib/fabriq/skype.rb', line 8

def adapter
  @adapter
end

Class Method Details

.listen_for_messages_to_self(&block) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/fabriq/skype.rb', line 26

def listen_for_messages_to_self(&block)
  adapter.subscribe_to_incoming_messages do |message|
    if message.private_session? || message.direct?
      block.call(message)
    end
  end
end

.room_by_id(room_id) ⇒ Object



18
19
20
# File 'lib/fabriq/skype.rb', line 18

def room_by_id(room_id)
  rooms.select { |room| room.id == room_id }.first
end

.roomsObject



14
15
16
# File 'lib/fabriq/skype.rb', line 14

def rooms
  adapter.rooms
end

.send_message(message) ⇒ Object



22
23
24
# File 'lib/fabriq/skype.rb', line 22

def send_message(message)
  adapter.enqueue_outgoing_message(message)
end