Class: OdaniaStaticPages::Config::Deploy::DockerCompose

Inherits:
Object
  • Object
show all
Defined in:
lib/odania_static_pages/config/docker_compose.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(state_file: 'docker_compose_state.yml', compose_images: [], expires: '-1', varnish_secret: nil) ⇒ DockerCompose

Returns a new instance of DockerCompose.



7
8
9
10
11
12
# File 'lib/odania_static_pages/config/docker_compose.rb', line 7

def initialize(state_file: 'docker_compose_state.yml', compose_images: [], expires: '-1', varnish_secret: nil)
	@state_file = state_file
	@compose_images = compose_images
	@expires = expires
	@varnish_secret = varnish_secret.nil? ? SecureRandom.hex : varnish_secret
end

Instance Attribute Details

#compose_imagesObject (readonly)

Returns the value of attribute compose_images.



5
6
7
# File 'lib/odania_static_pages/config/docker_compose.rb', line 5

def compose_images
  @compose_images
end

#expiresObject (readonly)

Returns the value of attribute expires.



5
6
7
# File 'lib/odania_static_pages/config/docker_compose.rb', line 5

def expires
  @expires
end

#state_fileObject (readonly)

Returns the value of attribute state_file.



5
6
7
# File 'lib/odania_static_pages/config/docker_compose.rb', line 5

def state_file
  @state_file
end

#varnish_secretObject (readonly)

Returns the value of attribute varnish_secret.



5
6
7
# File 'lib/odania_static_pages/config/docker_compose.rb', line 5

def varnish_secret
  @varnish_secret
end

Instance Method Details

#to_hObject



14
15
16
17
18
19
20
# File 'lib/odania_static_pages/config/docker_compose.rb', line 14

def to_h
	{
		state_file: @state_file,
		compose_images: @compose_images,
		expires: @expires
	}.stringify_keys!
end