Class: Bashly::LibrarySourceConfig

Inherits:
Object
  • Object
show all
Includes:
ValidationHelpers
Defined in:
lib/bashly/library_source_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ LibrarySourceConfig

Returns a new instance of LibrarySourceConfig.



7
8
9
# File 'lib/bashly/library_source_config.rb', line 7

def initialize(path)
  @path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



5
6
7
# File 'lib/bashly/library_source_config.rb', line 5

def path
  @path
end

Instance Method Details

#dataObject



11
12
13
# File 'lib/bashly/library_source_config.rb', line 11

def data
  @data ||= YAML.load_file path
end

#validateObject



20
21
22
# File 'lib/bashly/library_source_config.rb', line 20

def validate
  assert_root path, data
end

#validated_dataObject



15
16
17
18
# File 'lib/bashly/library_source_config.rb', line 15

def validated_data
  validate
  data
end