Class: Hcloud::Volume
Instance Attribute Summary
Attributes included from EntryLoader
#response
Instance Method Summary
collapse
#_attributes, #_load, #_run_callbacks, #_update_attribute, #client, #initialize, #inspect, #method_missing, #prepare_request, #resource_path, #resource_url, #respond_to_missing?, #rollback, #save, #update
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Hcloud::EntryLoader
Instance Method Details
#attach(server:, automount: nil) ⇒ Object
20
21
22
23
24
|
# File 'lib/hcloud/volume.rb', line 20
def attach(server:, automount: nil)
raise Hcloud::Error::InvalidInput, 'no server given' if server.nil?
prepare_request('actions/attach', j: COLLECT_ARGS.call(__method__, binding))
end
|
#detach ⇒ Object
26
27
28
|
# File 'lib/hcloud/volume.rb', line 26
def detach
prepare_request('actions/detach', method: :post)
end
|
#resize(size:) ⇒ Object
30
31
32
33
34
|
# File 'lib/hcloud/volume.rb', line 30
def resize(size:)
raise Hcloud::Error::InvalidInput, 'invalid size given' unless size.to_i > self.size
prepare_request('actions/resize', j: COLLECT_ARGS.call(__method__, binding))
end
|