Class: HCloud::Location

Inherits:
Resource show all
Defined in:
lib/hcloud/resources/location.rb

Overview

Represents a location

List all locations

HCloud::Location.all
# => [#<HCloud::Location id: 1, ...>, ...]

Sort locations

HCloud::Location.sort(name: :desc)
# => [#<HCloud::Location id: 1, ...>, ...]

HCloud::Location.sort(:id, name: :asc)
# => [#<HCloud::Location id: 1, ...>, ...]

Search locations

HCloud::Location.where(name: "fsn1")
# => #<HCloud::Location id: 1, ...>

Find location by ID

HCloud::Location.find(1)
# => #<HCloud::Location id: 1, ...>

Method Summary

Methods inherited from Resource

#==, attribute, client, #initialize, #inspect, resource_name, #to_h

Constructor Details

This class inherits a constructor from HCloud::Resource