attributor-flatpack 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a37ffa718fb1d4c654994475aae6d29c1c58f303
4
- data.tar.gz: 1c3383756317c34d64fb58569f84290aa55d955e
3
+ metadata.gz: d7c83619e69912dac110f8f66981c26904c3613b
4
+ data.tar.gz: a4379341c151eb0436fffcc3cd77630baa3b2efe
5
5
  SHA512:
6
- metadata.gz: df68bfef26a9fcd05bd5abc29246a4a5358cbd215ff7a9757545daed4683b5b08bf45eb44f3c95149cc76d04ad7422c94681506201f83dc449808d2e82f4cc3c
7
- data.tar.gz: 1451ec4ad454938ff1acefbe0e6cc3cdb5aad964a48c762fadf9a7f90fefc72fea5d01a24d8062a4d2ef6ab67a013f3d843579a3d2fba96b635e96bcfd51b9bd
6
+ metadata.gz: 336ef03e6940a442de9300e65ab433a2691f45f54d583329fba22fa146e190bce0e792504815b3ad810eaa179c120ab2d9ec96431b58e3d08c9698d3146a8148
7
+ data.tar.gz: 523cdd36a4554f3b54caa997e16c57c64459fc29c97341b36073483590d7aa52bfd9e336fb7c2339e973bdf2d685d7baddd8d2d3998c4f282ddd35627e0b859b
@@ -26,6 +26,13 @@ module Attributor
26
26
  config
27
27
  end
28
28
 
29
+ def self.example(context = nil, **values)
30
+ example = super
31
+ # Need the @raw to be set as well, since we're using it in fetch
32
+ example.instance_variable_set(:@raw, @contents.dup)
33
+ example
34
+ end
35
+
29
36
  def initialize(data = nil)
30
37
  @raw = data
31
38
  @contents = {}
@@ -41,12 +48,12 @@ module Attributor
41
48
  end
42
49
 
43
50
  def define_reader(name)
44
- attribute = self.class.keys[name]
45
51
  context = default_context(name)
46
52
  define_singleton_method(name) do
47
- get(name, attribute: attribute, context: context)
53
+ get(name, context: context)
48
54
  end
49
55
 
56
+ attribute = self.class.keys[name]
50
57
  return unless attribute.type == Attributor::Boolean
51
58
 
52
59
  define_singleton_method(name.to_s + '?') do
@@ -1,5 +1,5 @@
1
1
  module Attributor
2
2
  module Flatpack
3
- VERSION = '1.2.1'.freeze
3
+ VERSION = '1.2.2'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attributor-flatpack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dane Jensen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-10-19 00:00:00.000000000 Z
11
+ date: 2018-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: attributor