Class Capistrano::Role::DynamicServerList
In: lib/capistrano/role.rb
lib/capistrano/role.rb
Parent: Object

This is the combination of a block, a hash of options, and a cached value.

Methods

new   new   reset!   reset!   to_ary   to_ary  

Public Class methods

[Source]

    # File lib/capistrano/role.rb, line 49
49:       def initialize (block, options)
50:         @block = block
51:         @options = options
52:         @cached = []
53:         @is_cached = false
54:       end

[Source]

    # File lib/capistrano/role.rb, line 49
49:       def initialize (block, options)
50:         @block = block
51:         @options = options
52:         @cached = []
53:         @is_cached = false
54:       end

Public Instance methods

Clear the cached value

[Source]

    # File lib/capistrano/role.rb, line 66
66:       def reset!
67:         @cached.clear
68:         @is_cached = false
69:       end

Clear the cached value

[Source]

    # File lib/capistrano/role.rb, line 66
66:       def reset!
67:         @cached.clear
68:         @is_cached = false
69:       end

Convert to a list of ServerDefinitions

[Source]

    # File lib/capistrano/role.rb, line 57
57:       def to_ary
58:         unless @is_cached
59:           @cached = Role::wrap_list(@block.call(@options), @options)
60:           @is_cached = true
61:         end
62:         @cached
63:       end

Convert to a list of ServerDefinitions

[Source]

    # File lib/capistrano/role.rb, line 57
57:       def to_ary
58:         unless @is_cached
59:           @cached = Role::wrap_list(@block.call(@options), @options)
60:           @is_cached = true
61:         end
62:         @cached
63:       end

[Validate]