ribbon 0.4.0 → 0.4.1

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.
Files changed (3) hide show
  1. data/lib/ribbon.rb +12 -7
  2. data/lib/ribbon/version.rb +1 -1
  3. metadata +5 -5
data/lib/ribbon.rb CHANGED
@@ -82,12 +82,17 @@ class Ribbon < BasicObject
82
82
 
83
83
  # Handles the following cases:
84
84
  #
85
- # ribbon.method => ribbon[method]
86
- # ribbon.method value => ribbon[method] = value; ribbon[method]
87
- # ribbon.method &block => ribbon[method, &block]
88
- # ribbon.method = value => ribbon[method] = value
89
- # ribbon.method! value => ribbon[method] = value; self
90
- # ribbon.method? => ribbon.__hash__[method]
85
+ # ribbon.method => ribbon[method]
86
+ # ribbon.method value => ribbon[method] = value
87
+ # ribbon.method &block => ribbon[method, &block]
88
+ # ribbon.method value, &block => ribbon[method] = value
89
+ # ribbon[method, &block]
90
+ # ribbon.method = value => ribbon[method] = value
91
+ # ribbon.method! value => ribbon[method] = value
92
+ # self
93
+ # ribbon.method? => ribbon.__hash__.fetch method
94
+ # ribbon.method? value => ribbon.__hash__.fetch method, value
95
+ # ribbon.method? &block => ribbon.__hash__.fetch method, &block
91
96
  def method_missing(method, *args, &block)
92
97
  m = method.to_s.strip.gsub(/[=?!]$/, '').strip.to_sym
93
98
  case method.to_s[-1]
@@ -96,7 +101,7 @@ class Ribbon < BasicObject
96
101
  when '!'
97
102
  self[m] = args.first; self
98
103
  when '?'
99
- self.__hash__[m]
104
+ self.__hash__.fetch m, *args, &block
100
105
  else
101
106
  self[method] = args.first unless args.empty?
102
107
  self[method, &block]
@@ -16,7 +16,7 @@ class Ribbon < BasicObject
16
16
  # Patch version.
17
17
  #
18
18
  # Increments denote changes in implementation.
19
- PATCH = 0
19
+ PATCH = 1
20
20
 
21
21
  # Build version.
22
22
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ribbon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-01-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rookie
16
- requirement: &18324900 !ruby/object:Gem::Requirement
16
+ requirement: &13129880 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *18324900
24
+ version_requirements: *13129880
25
25
  description: Ruby Object Notation. Inspired by JSON and OpenStruct.
26
26
  email: matheus.a.m.moreira@gmail.com
27
27
  executables: []
@@ -54,7 +54,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
54
54
  version: '0'
55
55
  segments:
56
56
  - 0
57
- hash: 1159963088107678730
57
+ hash: -3778988951246687423
58
58
  required_rubygems_version: !ruby/object:Gem::Requirement
59
59
  none: false
60
60
  requirements:
@@ -63,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
63
  version: '0'
64
64
  segments:
65
65
  - 0
66
- hash: 1159963088107678730
66
+ hash: -3778988951246687423
67
67
  requirements: []
68
68
  rubyforge_project:
69
69
  rubygems_version: 1.8.10