Class: HipChat::Client
Instance Method Summary collapse
- #[](name) ⇒ Object
-
#initialize(token, options = {}) ⇒ Client
constructor
A new instance of Client.
- #rooms ⇒ Object
Constructor Details
#initialize(token, options = {}) ⇒ Client
Returns a new instance of Client.
19 20 21 22 23 24 |
# File 'lib/hipchat-chef.rb', line 19 def initialize(token, ={}) @token = token http_proxy = [:http_proxy] || ENV['http_proxy'] setup_proxy(http_proxy) if http_proxy end |
Instance Method Details
#[](name) ⇒ Object
31 32 33 |
# File 'lib/hipchat-chef.rb', line 31 def [](name) Room.new(@token, :room_id => name) end |
#rooms ⇒ Object
26 27 28 29 |
# File 'lib/hipchat-chef.rb', line 26 def rooms @rooms ||= self.class.get("/list", :query => {:auth_token => @token})['rooms']. map { |r| Room.new(@token, r) } end |