Module: YamlProperties

Extended by:
YamlProperties
Included in:
YamlProperties
Defined in:
lib/yaml_properties.rb,
lib/yaml_properties/version.rb

Defined Under Namespace

Classes: Diff

Constant Summary collapse

VERSION =
"0.0.8"

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



17
18
19
20
21
# File 'lib/yaml_properties.rb', line 17

def method_missing(key, *args, &block)
  return properties[key] if properties.keys.include? key.to_s

  super key, *args, &block
end

Instance Method Details

#override_attribute(attribute, value) ⇒ Object



23
24
25
# File 'lib/yaml_properties.rb', line 23

def override_attribute attribute, value
  properties[attribute] = value
end

#propertiesObject



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

def properties
  @properties ||= load_properties.with_indifferent_access
end

#reset!Object



9
10
11
# File 'lib/yaml_properties.rb', line 9

def reset!
  reset_properties
end

#reset_propertiesObject



13
14
15
# File 'lib/yaml_properties.rb', line 13

def reset_properties
  @properties = nil
end