Class: Wright::Provider

Inherits:
Object
  • Object
show all
Defined in:
lib/wright/provider.rb,
lib/wright/provider/file.rb,
lib/wright/provider/user.rb,
lib/wright/provider/group.rb,
lib/wright/provider/package.rb,
lib/wright/provider/symlink.rb,
lib/wright/provider/directory.rb,
lib/wright/provider/package/apt.rb,
lib/wright/provider/package/yum.rb,
lib/wright/provider/user/gnu_passwd.rb,
lib/wright/provider/group/gnu_passwd.rb,
lib/wright/provider/package/homebrew.rb,
lib/wright/provider/user/darwin_directory_service.rb,
lib/wright/provider/group/darwin_directory_service.rb

Overview

Provider class.

Direct Known Subclasses

Directory, File, Group, Package, Symlink, User

Defined Under Namespace

Classes: Directory, File, Group, Package, Symlink, User

Constant Summary collapse

PROVIDER_DIR =

Wright standard provider directory

File.expand_path('provider', File.dirname(__FILE__))

Instance Method Summary collapse

Constructor Details

#initialize(resource) ⇒ Provider

Initializes a Provider.

Parameters:

  • resource (Resource)

    the resource used by the provider



18
19
20
21
# File 'lib/wright/provider.rb', line 18

def initialize(resource)
  @resource = resource
  @updated = false
end

Instance Method Details

#updated?Bool

Checks if the provider was updated since the last call to #updated?

Returns:

  • (Bool)

    true if the provider was updated and false otherwise



28
29
30
31
32
# File 'lib/wright/provider.rb', line 28

def updated?
  updated_since_last_call = updated
  self.updated = false
  updated_since_last_call
end