campfiyah 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -25,7 +25,15 @@ require 'campfiyah'
25
25
 
26
26
  ```ruby
27
27
  account = Campfiyah::Account.new(default_subdomain, default_token)
28
- room = account.find_room("The Danger Room")
28
+ room = account.room_by_name("The Danger Room")
29
+ room.message("woot")
30
+ ```
31
+
32
+ Or you can find rooms by id
33
+
34
+ ```ruby
35
+ account = Campfiyah::Account.new(default_subdomain, default_token)
36
+ room = account.room_by_id(123456)
29
37
  room.message("woot")
30
38
  ```
31
39
 
@@ -12,11 +12,11 @@ module Campfiyah
12
12
  def rooms
13
13
  @rooms ||= @adapter.rooms.map do |room|
14
14
  Room.from_hash(room, @adapter)
15
- end
15
+ end.sort { |a,b| a.name <=> b.name }
16
16
  end
17
17
 
18
18
  def room_by_id(id)
19
- rooms.find {|r| r.id == id}
19
+ rooms.find {|r| r.id.to_i == id.to_i}
20
20
  end
21
21
 
22
22
  def room_by_name(name)
@@ -1,3 +1,3 @@
1
1
  module Campfiyah
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/spec/account_spec.rb CHANGED
@@ -15,6 +15,10 @@ describe Campfiyah::Account do
15
15
 
16
16
  room = account.room_by_id(123456)
17
17
  room.name.should eql("The Danger Room")
18
+
19
+ room = account.room_by_id("123456")
20
+ room.name.should eql("The Danger Room")
21
+
18
22
  room.message("woot").should be
19
23
  end
20
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: campfiyah
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: