yaml-ostruct 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,6 +12,10 @@ module YamlOstruct
12
12
  @config = nil
13
13
  end
14
14
 
15
+ class << self
16
+ alias_method :delete_all, :clear
17
+ end
18
+
15
19
  def self.method_missing(method_sym, *args)
16
20
  @config ||= YamlOstructImpl.new
17
21
  @config.send method_sym, *args
@@ -1,4 +1,4 @@
1
1
  # yaml-ostruct gem version
2
2
  module YamlOstruct
3
- VERSION = '0.3.0'
3
+ VERSION = '0.4.0'
4
4
  end
@@ -17,12 +17,16 @@ module YamlOstruct
17
17
  @deep_merge = args.fetch :deep_merge, false
18
18
  end
19
19
 
20
+ def delete(key)
21
+ @config.delete_field(key)
22
+ end
23
+
20
24
  def method_missing(method_sym, *args)
21
25
  if @config.respond_to? method_sym
22
26
  @config.send method_sym, *args
23
27
  elsif method_sym.to_s.end_with?('=')
24
28
  @config.send method_sym, *args
25
- elsif method_sym == :clear
29
+ elsif method_sym == :clear || method_sym == :delete_all
26
30
  @config = OpenStruct.new
27
31
  else
28
32
  nil
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yaml-ostruct
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-06-25 00:00:00.000000000 Z
12
+ date: 2016-10-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: hashugar