Sha256: 587be232f2478f49c6876279cfef42ebcfb22f865702baf171aa3124a25ae65c

Contents?: true

Size: 282 Bytes

Versions: 7

Compression:

Stored size: 282 Bytes

Contents

# frozen_string_literal: true

module Hcloud
  class LocationResource < AbstractResource
    filter_attributes :name

    bind_to Location

    def [](arg)
      case arg
      when Integer then find_by(id: arg)
      when String then find_by(name: arg)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
hcloud-1.3.0 lib/hcloud/location_resource.rb
hcloud-1.2.0 lib/hcloud/location_resource.rb
hcloud-1.1.0 lib/hcloud/location_resource.rb
hcloud-1.0.3 lib/hcloud/location_resource.rb
hcloud-1.0.2 lib/hcloud/location_resource.rb
hcloud-1.0.1 lib/hcloud/location_resource.rb
hcloud-1.0.0 lib/hcloud/location_resource.rb