Class: Fog::Compute::ProfitBricks::IpBlock
Instance Method Summary
collapse
#flatten
#request_status, #wait_for
Constructor Details
#initialize(attributes = {}) ⇒ IpBlock
Returns a new instance of IpBlock.
27
28
29
|
# File 'lib/fog/profitbricks/models/compute/ip_block.rb', line 27
def initialize(attributes = {})
super
end
|
Instance Method Details
#delete ⇒ Object
44
45
46
47
48
|
# File 'lib/fog/profitbricks/models/compute/ip_block.rb', line 44
def delete
requires :id
service.delete_ip_block(id)
true
end
|
#failed? ⇒ Boolean
54
55
56
|
# File 'lib/fog/profitbricks/models/compute/ip_block.rb', line 54
def failed?
state == 'ERROR'
end
|
#ready? ⇒ Boolean
50
51
52
|
# File 'lib/fog/profitbricks/models/compute/ip_block.rb', line 50
def ready?
state == 'AVAILABLE'
end
|
#save ⇒ Object
31
32
33
34
35
36
37
38
39
40
41
42
|
# File 'lib/fog/profitbricks/models/compute/ip_block.rb', line 31
def save
requires :location, :size
properties = {}
properties[:location] = location if location
properties[:size] = size if size
properties[:name] = name if name
data = service.create_ip_block(properties)
merge_attributes(flatten(data.body))
true
end
|