Class: Moku::ReleaseSignature

Inherits:
Object
  • Object
show all
Defined in:
lib/moku/release_signature.rb

Overview

Uniquely identifies an app at a point in time, including the machinery used to deploy it.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source:, deploy:, infrastructure:, dev:) ⇒ ReleaseSignature

Returns a new instance of ReleaseSignature.

Parameters:


24
25
26
27
28
29
# File 'lib/moku/release_signature.rb', line 24

def initialize(source:, deploy:, infrastructure:, dev:)
  @source = source
  @deploy = deploy
  @infrastructure = infrastructure
  @dev = dev
end

Instance Attribute Details

#deployObject (readonly)

Returns the value of attribute deploy


31
32
33
# File 'lib/moku/release_signature.rb', line 31

def deploy
  @deploy
end

#devObject (readonly)

Returns the value of attribute dev


31
32
33
# File 'lib/moku/release_signature.rb', line 31

def dev
  @dev
end

#infrastructureObject (readonly)

Returns the value of attribute infrastructure


31
32
33
# File 'lib/moku/release_signature.rb', line 31

def infrastructure
  @infrastructure
end

#sourceObject (readonly)

Returns the value of attribute source


31
32
33
# File 'lib/moku/release_signature.rb', line 31

def source
  @source
end

Class Method Details

.from_hash(hash) ⇒ Object


11
12
13
14
15
16
17
18
# File 'lib/moku/release_signature.rb', line 11

def self.from_hash(hash)
  new(
    source: ArchiveReference.from_hash(hash[:source]),
    deploy: ArchiveReference.from_hash(hash[:deploy]),
    infrastructure: ArchiveReference.from_hash([hash.fetch(:infrastructure, [])].flatten.first),
    dev:    ArchiveReference.from_hash([hash.fetch(:dev, [])].flatten.first)
  )
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)

33
34
35
# File 'lib/moku/release_signature.rb', line 33

def eql?(other)
  to_hash == other.to_hash
end

#to_hashObject


37
38
39
40
41
42
43
44
# File 'lib/moku/release_signature.rb', line 37

def to_hash
  {
    source:         source.to_hash,
    deploy:         deploy.to_hash,
    infrastructure: infrastructure.to_hash,
    dev:            dev.to_hash
  }
end