lib/hcloud/volume.rb in hcloud-1.1.0 vs lib/hcloud/volume.rb in hcloud-1.2.0

- old
+ new

@@ -15,18 +15,22 @@ updatable :name destructible has_actions - def attach(server:, automount:) + 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 def detach prepare_request('actions/detach', method: :post) end 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 end end