Class: Herdsman::HerdMemberConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/herdsman/herd_member_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, args = {}, overrides = {}, defaults = {}) ⇒ HerdMemberConfig

Returns a new instance of HerdMemberConfig.



4
5
6
7
8
9
10
# File 'lib/herdsman/herd_member_config.rb', line 4

def initialize(path, args = {}, overrides = {}, defaults = {})
  @path      = path
  @args      = args
  @overrides = overrides
  @defaults  = defaults
  validate!
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



3
4
5
# File 'lib/herdsman/herd_member_config.rb', line 3

def path
  @path
end

Instance Method Details

#fetch_cacheObject



24
25
26
27
28
# File 'lib/herdsman/herd_member_config.rb', line 24

def fetch_cache
  overridable_arg('fetch_cache').to_i
rescue
  default_fetch_cache
end

#nameObject



12
13
14
15
16
# File 'lib/herdsman/herd_member_config.rb', line 12

def name
  args.fetch('name')
rescue
  default_name
end

#revisionObject



18
19
20
21
22
# File 'lib/herdsman/herd_member_config.rb', line 18

def revision
  overridable_arg('revision')
rescue
  default_revision
end