Sha256: 35e2b01d9784b1c48f8cae236b26ac729119c3ab9b7fe7c4c7ef89b85fed16c7
Contents?: true
Size: 566 Bytes
Versions: 4
Compression:
Stored size: 566 Bytes
Contents
# frozen_string_literal: true module Hcloud class NetworkResource < AbstractResource filter_attributes :name bind_to Network def [](arg) case arg when Integer then find_by(id: arg) when String then find_by(name: arg) end end def create(name:, ip_range:, subnets: nil, routes: nil) prepare_request( 'networks', j: COLLECT_ARGS.call(__method__, binding), expected_code: 201 ) do |response| Network.new(client, response.parsed_json[:network]) end end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
hcloud-1.0.3 | lib/hcloud/network_resource.rb |
hcloud-1.0.2 | lib/hcloud/network_resource.rb |
hcloud-1.0.1 | lib/hcloud/network_resource.rb |
hcloud-1.0.0 | lib/hcloud/network_resource.rb |