chatbox 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d1dc4166223405dcc13dfee12cb0235cd95c7ae7
4
- data.tar.gz: 62e0ca3a43df9cd1dcade47072105939cc9690d4
3
+ metadata.gz: e6ad08c199c036d9537849e7dee035ff14a1084e
4
+ data.tar.gz: f0f6622961ca50cf53c19994a1e1cad8fbf25d09
5
5
  SHA512:
6
- metadata.gz: 045a0f5b936cbff0e9bb1e68b6ec740457881a565091a4ff0003d4e2c8ca752c47482d6f276bccdc5f80f11239516b1b5b4fb4836ec4c1e0464ceac3a1d5e327
7
- data.tar.gz: 71ad790f0d3332334d40bcdcfb2484afce682aa35c1a810ab566f8fa948f8aeec9ccc61d994281ae207315f1e44a0bceee7747f72c766d995df446ed13f96b94
6
+ metadata.gz: 7fe1ae1ce10604d614694ec7d2ad6d78b5ccdb002e4afc333e719f6b0d121a62b96325280746beb715735854450717a8d6542613bccff59ad1a5a8abf7790ff6
7
+ data.tar.gz: 35caadb705b534d891aa817e97a9562f13cfb929bc0f12e897abf3e6d48df5cb6bd2dbb63354913080a8287f0450363919bf37da6e096e2cabcb682385bfe930
@@ -1,14 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - "2.0.0"
4
- - "2.1.2"
5
4
  - ruby-head
6
- - jruby-1.7.12
7
- - jruby-head
8
- - rbx-2.0.0
9
- - rbx-2.1.1
10
- - rbx-2.2.6
11
- - rbx-head
12
5
  script: bundle exec rspec
13
6
  before_install:
14
- - gem install bundler
7
+ - gem install bundler
data/README.md CHANGED
@@ -20,7 +20,22 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
 
23
- TODO: Write usage instructions here
23
+ ```ruby
24
+ Person = Struct.new :chatbox_id
25
+
26
+ austin = Person.new 1
27
+ rachel = Person.new 2
28
+
29
+ Chatbox.deliver_message! from: austin, to: rachel, body: 'Hello! How are you?'
30
+
31
+ rachels_inbox = Chatbox.fetch_inbox_for rachel
32
+ message = rachels_inbox[0]
33
+ message.body # 'Hello! How are you?'
34
+
35
+ austins_outbox = Chatbox.fetch_outbox_for austin
36
+ message = austins_outbox[0]
37
+ message.body # 'Hello! How are you?'
38
+ ```
24
39
 
25
40
  ## Contributing
26
41
 
@@ -1,6 +1,10 @@
1
+ require 'chatbox/fake_missing_keywords'
2
+
1
3
  module Chatbox
2
4
  class Draft
3
- def initialize(from:, to:, body:, store:)
5
+ include FakeMissingKeywords
6
+
7
+ def initialize(from: req(:from), to: req(:to), body: req(:body), store: req(:store))
4
8
  @from_id = from.chatbox_id
5
9
  @to_id = to.chatbox_id
6
10
  @body = body
@@ -0,0 +1,7 @@
1
+ module Chatbox
2
+ module FakeMissingKeywords
3
+ def req(keyword)
4
+ raise ArgumentError, "at least one missing keyword: #{keyword}"
5
+ end
6
+ end
7
+ end
@@ -1,6 +1,10 @@
1
+ require 'chatbox/fake_missing_keywords'
2
+
1
3
  module Chatbox
2
4
  class Inbox
3
- def initialize(entity:, store:)
5
+ include FakeMissingKeywords
6
+
7
+ def initialize(entity: req(:entity), store: req(:store))
4
8
  @id = entity.chatbox_id
5
9
  @store = store
6
10
  end
@@ -1,6 +1,10 @@
1
+ require 'chatbox/fake_missing_keywords'
2
+
1
3
  module Chatbox
2
4
  class Outbox
3
- def initialize(entity:, store:)
5
+ include FakeMissingKeywords
6
+
7
+ def initialize(entity: req(:entity), store: req(:store))
4
8
  @id = entity.chatbox_id
5
9
  @store = store
6
10
  end
@@ -1,3 +1,3 @@
1
1
  module Chatbox
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chatbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Austin Schneider
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-21 00:00:00.000000000 Z
11
+ date: 2014-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -84,6 +84,7 @@ files:
84
84
  - lib/chatbox.rb
85
85
  - lib/chatbox/configuration.rb
86
86
  - lib/chatbox/draft.rb
87
+ - lib/chatbox/fake_missing_keywords.rb
87
88
  - lib/chatbox/inbox.rb
88
89
  - lib/chatbox/memory_store.rb
89
90
  - lib/chatbox/outbox.rb