Class: XcodeServer::Server
- Inherits:
-
Object
- Object
- XcodeServer::Server
- Includes:
- Networking
- Defined in:
- lib/xcode_server/server.rb,
lib/xcode_server/server/networking.rb
Defined Under Namespace
Modules: Networking
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#scheme ⇒ Object
readonly
Returns the value of attribute scheme.
Instance Method Summary collapse
- #bots ⇒ Object
- #destroy_bot(id, rev = nil) ⇒ Object
-
#initialize(host, scheme = 'https') ⇒ Server
constructor
A new instance of Server.
Methods included from Networking
Constructor Details
#initialize(host, scheme = 'https') ⇒ Server
Returns a new instance of Server.
10 11 12 13 |
# File 'lib/xcode_server/server.rb', line 10 def initialize(host, scheme = 'https') @host = host @scheme = scheme end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
8 9 10 |
# File 'lib/xcode_server/server.rb', line 8 def host @host end |
#scheme ⇒ Object (readonly)
Returns the value of attribute scheme.
7 8 9 |
# File 'lib/xcode_server/server.rb', line 7 def scheme @scheme end |
Instance Method Details
#bots ⇒ Object
15 16 17 |
# File 'lib/xcode_server/server.rb', line 15 def bots get_json('bots')['results'].map { |result| Bot.new(self, result) } end |
#destroy_bot(id, rev = nil) ⇒ Object
19 20 21 22 |
# File 'lib/xcode_server/server.rb', line 19 def destroy_bot(id, rev = nil) rev ||= get_json("bots/#{id}")['_rev'] delete("bots/#{id}/#{rev}").code.to_i == 204 end |