Class: BitBalloon::Site
Instance Attribute Summary
Attributes inherited from Model
#attributes, #client, #prefix
Instance Method Summary
collapse
Methods inherited from Model
#collection, collection, #destroy, fields, #initialize, #path, #process, #refresh
Instance Method Details
#deploys ⇒ Object
56
57
58
|
# File 'lib/bitballoon/site.rb', line 56
def deploys
Deploys.new(client, path)
end
|
#destroy! ⇒ Object
35
36
37
38
|
# File 'lib/bitballoon/site.rb', line 35
def destroy!
client.request(:delete, path)
true
end
|
#error? ⇒ Boolean
14
15
16
|
# File 'lib/bitballoon/site.rb', line 14
def error?
state == "error"
end
|
#files ⇒ Object
48
49
50
|
# File 'lib/bitballoon/site.rb', line 48
def files
Files.new(client, path)
end
|
40
41
42
|
# File 'lib/bitballoon/site.rb', line 40
def forms
Forms.new(client, path)
end
|
#ready? ⇒ Boolean
10
11
12
|
# File 'lib/bitballoon/site.rb', line 10
def ready?
state == "current"
end
|
#snippets ⇒ Object
52
53
54
|
# File 'lib/bitballoon/site.rb', line 52
def snippets
Snippets.new(client, path)
end
|
#submissions ⇒ Object
44
45
46
|
# File 'lib/bitballoon/site.rb', line 44
def submissions
Submissions.new(client, path)
end
|
#update(attributes) ⇒ Object
25
26
27
28
29
30
31
32
33
|
# File 'lib/bitballoon/site.rb', line 25
def update(attributes)
response = client.request(:put, path, :body => mutable_attributes(attributes))
process(response.parsed)
if attributes[:zip] || attributes[:dir]
deploy = deploys.create(attributes)
self.deploy_id = deploy.id
end
self
end
|
#wait_for_ready(timeout = 900, &block) ⇒ Object
18
19
20
21
22
23
|
# File 'lib/bitballoon/site.rb', line 18
def wait_for_ready(timeout = 900, &block)
deploy = deploys.get(deploy_id)
raise "Error fetching deploy #{deploy_id}" unless deploy
deploy.wait_for_ready(timeout, &block)
self
end
|