Class: EmberCliDeployRedis::RevisionList

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/ember_cli_deploy_redis/revision_list.rb

Overview

Holds a list of deployed application revisions that may be used. Delegates to the array of revisions, so standard Array methods can be called.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(application, revisions) ⇒ RevisionList

Returns a new instance of RevisionList.



14
15
16
17
18
# File 'lib/ember_cli_deploy_redis/revision_list.rb', line 14

def initialize(application, revisions)
  self.application = application
  self.revisions = revisions
  super(revisions)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/ember_cli_deploy_redis/revision_list.rb', line 20

def method_missing(method, *args, &block)
  if revisions.respond_to? method
    revisions.send(method, *args, &block)
  else
    super
  end
end

Instance Attribute Details

#applicationObject

Returns the value of attribute application.



7
8
9
# File 'lib/ember_cli_deploy_redis/revision_list.rb', line 7

def application
  @application
end

#revisionsObject

Returns the value of attribute revisions.



8
9
10
# File 'lib/ember_cli_deploy_redis/revision_list.rb', line 8

def revisions
  @revisions
end

Class Method Details

.from_redis(application) ⇒ Object



10
11
12
# File 'lib/ember_cli_deploy_redis/revision_list.rb', line 10

def self.from_redis(application)
  new application, list_from_redis(application).map { |r| Revision.new(application, r) }
end