Class: ResourceStageContext Private

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
Library/Homebrew/resource.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

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. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ResourceStageContext.


265
266
267
268
# File 'Library/Homebrew/resource.rb', line 265

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

Instance Attribute Details

#resourceObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The Resource that is being staged


258
259
260
# File 'Library/Homebrew/resource.rb', line 258

def resource
  @resource
end

#stagingObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The Mktemp in which #resource is staged


260
261
262
# File 'Library/Homebrew/resource.rb', line 260

def staging
  @staging
end

Instance Method Details

#to_sObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


270
271
272
# File 'Library/Homebrew/resource.rb', line 270

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