Module: Chatbox

Extended by:
Chatbox
Included in:
Chatbox
Defined in:
lib/chatbox.rb,
lib/chatbox/draft.rb,
lib/chatbox/inbox.rb,
lib/chatbox/outbox.rb,
lib/chatbox/message.rb,
lib/chatbox/version.rb,
lib/chatbox/memory_store.rb,
lib/chatbox/configuration.rb,
lib/chatbox/memcached_store.rb,
lib/chatbox/fake_missing_keywords.rb

Defined Under Namespace

Modules: FakeMissingKeywords Classes: Configuration, Draft, Inbox, MemcachedStore, MemoryStore, Message, Outbox

Constant Summary collapse

VERSION =
'0.2.0'

Instance Method Summary collapse

Instance Method Details

#configure {|config| ... } ⇒ Object

Yields:

  • (config)


12
13
14
# File 'lib/chatbox.rb', line 12

def configure
  yield config
end

#deliver_message!(args) ⇒ Object



21
22
23
24
# File 'lib/chatbox.rb', line 21

def deliver_message!(args)
  args.merge! store: store
  Draft.new(args).deliver!
end

#fetch_inbox_for(entity) ⇒ Object



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

def fetch_inbox_for(entity)
  Inbox.new entity: entity, store: store
end

#fetch_outbox_for(entity) ⇒ Object



30
31
32
# File 'lib/chatbox.rb', line 30

def fetch_outbox_for(entity)
  Outbox.new entity: entity, store: store
end

#reset_config!Object



16
17
18
19
# File 'lib/chatbox.rb', line 16

def reset_config!
  @config = nil
  @store = nil
end