Class: ResourceStageContext Private

Inherits:
Object show all
Extended by:
Forwardable
Defined in:
resource.rb

Overview

This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.

The context in which a Resource#stage occurs. Supports access to both the Resource and associated Mktemp in a single block argument. The interface is back-compatible with Resource itself as used in that context.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resource, staging) ⇒ ResourceStageContext

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns a new instance of ResourceStageContext.



303
304
305
306
# File 'resource.rb', line 303

def initialize(resource, staging)
  @resource = resource
  @staging = staging
end

Instance Attribute Details

#resourceObject (readonly)

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

The Resource that is being staged.



296
297
298
# File 'resource.rb', line 296

def resource
  @resource
end

#stagingObject (readonly)

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

The Mktemp in which #resource is staged.



298
299
300
# File 'resource.rb', line 298

def staging
  @staging
end

Instance Method Details

#to_sString

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:



309
310
311
# File 'resource.rb', line 309

def to_s
  "<#{self.class}: resource=#{resource} staging=#{staging}>"
end