Sha256: 48de65a587ece3d4c07e72fb4bd0619e8f5de01403c79a896f18a556ba5daadf

Contents?: true

Size: 788 Bytes

Versions: 1

Compression:

Stored size: 788 Bytes

Contents

require 'wright/util/recursive_autoloader'

module Wright
  # Public: Provider class.
  class Provider
    # Public: Wright standard provider directory.
    PROVIDER_DIR = File.expand_path('provider', File.dirname(__FILE__))

    Wright::Util::RecursiveAutoloader.add_autoloads(PROVIDER_DIR, name)

    # Public: Initialize a Provider.
    #
    # resource - The resource used by the provider, typically a
    #            Wright::Resource.
    def initialize(resource)
      @resource = resource
      @updated = false
    end

    # Public: Checks if the provider was updated since the last call
    # to updated?.
    #
    # Returns true if the provider was updated and false otherwise.
    def updated?
      updated = @updated
      @updated = false
      updated
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wright-0.1.0 lib/wright/provider.rb