Sha256: 3a7c5207b05a7a6f64392e1d2098af983aad2af4f5cc975dd2b831442c03291c

Contents?: true

Size: 583 Bytes

Versions: 10

Compression:

Stored size: 583 Bytes

Contents

module ProfitBricks
  # Location class
  class Location < ProfitBricks::Model

    class << self

      # List all locations.
      def list
        response = ProfitBricks.request(
          method: :get,
          path: "/locations",
          expects: 200
        )
        instantiate_objects(response)
      end

      # Retrieve a location.
      def get(location_id)
        response = ProfitBricks.request(
          method: :get,
          path: "/locations/#{location_id}",
          expects: 200
        )
        instantiate_objects(response)
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
profitbricks-sdk-ruby-4.0.1 lib/profitbricks/location.rb
profitbricks-sdk-ruby-4.0.0 lib/profitbricks/location.rb
profitbricks-sdk-ruby-3.0.2 lib/profitbricks/location.rb
profitbricks-sdk-ruby-3.0.1 lib/profitbricks/location.rb
profitbricks-sdk-ruby-3.0.0 lib/profitbricks/location.rb
profitbricks-sdk-ruby-1.1.0 lib/profitbricks/location.rb
profitbricks-sdk-ruby-1.0.5 lib/profitbricks/location.rb
profitbricks-sdk-ruby-1.0.4 lib/profitbricks/location.rb
profitbricks-sdk-ruby-1.0.3 lib/profitbricks/location.rb
profitbricks-sdk-ruby-1.0.2 lib/profitbricks/location.rb