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/user/gnu_passwd.rb,
lib/wright/provider/group/gnu_passwd.rb,
lib/wright/provider/package/homebrew.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



16
17
18
19
# File 'lib/wright/provider.rb', line 16

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



26
27
28
29
30
# File 'lib/wright/provider.rb', line 26

def updated?
  updated = @updated
  @updated = false
  updated
end