nagare 1.0.0 → 1.1.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/nagare.rb +10 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a1fd9b7a915c71f1ac16a5155923c05479686343
4
- data.tar.gz: 7d5229fb81bc664bc5a038fce4c35d7dd6415a97
3
+ metadata.gz: 24f1510eda49b369d6c69f24e33d9a3cb11914c8
4
+ data.tar.gz: 5eafbf348527c7d8d8e8df21821d58c92c314d73
5
5
  SHA512:
6
- metadata.gz: 69837e19a4ea03e13d86b41d8692547ca6130663a84484eeced53aa7a6f10ae21bf0302633d8cf5752fe117117de95507e5ebf3d20368f2567546cc5fda32729
7
- data.tar.gz: 7a3b832d0df34f00a70676782acb808d368abaf8ab5771e99b87b09af64e150051ba50698609889c479f3f92ced7ae5c4d30989885d5496bed41350943f2f01d
6
+ metadata.gz: af2d197321acf3cf9131ab3bb334cda0c3ec7475ecc843c2f9fa6ccbb8e2c29bb3166c5230377f0ede1ad999f647449cd9888644b972dc1d91dcb92e35570ea9
7
+ data.tar.gz: 4b8859febe2b2827fb8ecc703cd39ce20e6c9a4933b4f805e3a6b5554da17f8a3a5813fa2195ad9add4eb28786aa73f9bbad3b3674c4467f662b3ea805c8e358
data/lib/nagare.rb CHANGED
@@ -21,6 +21,12 @@ module Nagare
21
21
  end
22
22
  end
23
23
 
24
+ def self.inherited(base)
25
+ base.instance_variable_set(:@attributes, @attributes.dup) if @attributes
26
+
27
+ super
28
+ end
29
+
24
30
  def initialize(object, context)
25
31
  @object = object
26
32
  @context = context
@@ -117,6 +123,10 @@ module Nagare
117
123
  Context.new(@attributes.merge(attributes))
118
124
  end
119
125
 
126
+ def [](key)
127
+ @attributes[key]
128
+ end
129
+
120
130
  def respond_to?(key, private_methods = false)
121
131
  @attributes.has_key?(key) || super
122
132
  end
@@ -124,8 +134,6 @@ module Nagare
124
134
  def method_missing(method)
125
135
  if @attributes.has_key?(method)
126
136
  @attributes.fetch(method)
127
- else
128
- super
129
137
  end
130
138
  end
131
139
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nagare
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Oestrich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-23 00:00:00.000000000 Z
11
+ date: 2016-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport