Sha256: 14a8e75b5bc62f1190419e40f86690381ec346afb28009e43b2d2ea89620ad82

Contents?: true

Size: 407 Bytes

Versions: 4

Compression:

Stored size: 407 Bytes

Contents

module Hcloud
  class AbstractResource
    attr_reader :client, :parent, :base_path

    def initialize(client:, parent: nil, base_path: "")
      @client = client
      @parent = parent
      @base_path = base_path
    end
    
    def each(&block)
      all.each do |member|
        block.call(member)
      end
    end

    protected

    def request(*args)
      client.request(*args)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hcloud-0.1.0.pre.alpha4 lib/hcloud/abstract_resource.rb
hcloud-0.1.0.pre.alpha3 lib/hcloud/abstract_resource.rb
hcloud-0.1.0.pre.alpha2 lib/hcloud/abstract_resource.rb
hcloud-0.1.0.pre.alpha1 lib/hcloud/abstract_resource.rb