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 45
45:       def initialize (block, options)
46:         @block = block
47:         @options = options
48:         @cached = []
49:         @is_cached = false
50:       end

[Source]

    # File lib/capistrano/role.rb, line 45
45:       def initialize (block, options)
46:         @block = block
47:         @options = options
48:         @cached = []
49:         @is_cached = false
50:       end

Public Instance methods

Clear the cached value

[Source]

    # File lib/capistrano/role.rb, line 62
62:       def reset!
63:         @cached.clear
64:         @is_cached = false
65:       end

Clear the cached value

[Source]

    # File lib/capistrano/role.rb, line 62
62:       def reset!
63:         @cached.clear
64:         @is_cached = false
65:       end

Convert to a list of ServerDefinitions

[Source]

    # File lib/capistrano/role.rb, line 53
53:       def to_ary
54:         unless @is_cached
55:           @cached = Role::wrap_list(@block.call(@options), @options)
56:           @is_cached = true
57:         end
58:         @cached
59:       end

Convert to a list of ServerDefinitions

[Source]

    # File lib/capistrano/role.rb, line 53
53:       def to_ary
54:         unless @is_cached
55:           @cached = Role::wrap_list(@block.call(@options), @options)
56:           @is_cached = true
57:         end
58:         @cached
59:       end

[Validate]