attire 0.1.3 → 0.1.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3a08fce3f81d2d6cc8e85c5c3bce1c57792e6351
4
- data.tar.gz: 056bb3398521ecd68c08e0da79748f9131824298
3
+ metadata.gz: 9e5925a4cfc382fbdb58206a32e9b2c48952b5ce
4
+ data.tar.gz: 7ae88651bbceccaf71b924e657d186ce762e581b
5
5
  SHA512:
6
- metadata.gz: 84b6ed2e93f4808e9d34e1c00ce7729f314d43676a0bb19cbd9c0d3d33b880255488bebaaead32995c126f46d0f20e6469aed86826c74a2691a6a76d0b60417d
7
- data.tar.gz: a8e2f70658231f95e5461dd5a00138071f6be4a5aab8d4ff18968ef4065c9b54cbf5e7250c4f37ac0a2d251e026c293bf9c5e1f8a57b2f02eb4eafa966a559f5
6
+ metadata.gz: 6c22d2e332413f498157b1309dd24ac30902cf5e852a98249f011f55853728d76201a77d250b4073efd9abb30f37f9ac4acaba292aec9ab3c964fc98ff8457e1
7
+ data.tar.gz: 5e7fe15ae4b53d3db1064d82885000d1cfc07a96e63263c831968da1bf2244d97bef02ca352823997c1601d85d30d5cae7614160ef4cbb05b0c1ff0a049687d1
data/README.md CHANGED
@@ -43,31 +43,32 @@ end
43
43
  Defines the following:
44
44
 
45
45
  ``` ruby
46
- attr_init :bar
47
-
48
46
  def self.select(*args, &block)
49
47
  new(*args, &block).select
50
48
  end
49
+
50
+ attr_init :bar
51
51
  ```
52
52
 
53
53
  This is useful for method objects/use cases:
54
54
 
55
55
  ``` ruby
56
56
  class CheeseSpreader
57
- attr_method :spread, :cheese, crackers: Jacobs.new
57
+ attr_method :spread, :cheese, crackers_class: Jacobs
58
58
 
59
59
  def spread
60
- raise CheeseError unless cheese.is_a?(Cheddar)
61
- cheese.spread_on(crackers)
60
+ cracker = crackers_class.new
61
+ cracker.spreads << cheese
62
+ cracker
62
63
  end
63
64
  end
64
65
 
65
- CheeseSpreader.spread(Roquefort.new) # CheeseError
66
+ CheeseSpreader.spread(roquefort)
66
67
  ```
67
68
 
68
69
  ### `attr_query :foo?`
69
70
 
70
- Defines query `foo?`, which is true if `foo` is truthy.
71
+ Defines query `#foo?`, which is true if `foo` is truthy.
71
72
 
72
73
  ## Installation
73
74
 
@@ -42,7 +42,7 @@ module Attire
42
42
 
43
43
  def set_optional(name, value)
44
44
  name, default = name.to_s.split('=').map(&:strip)
45
- value = eval(default) if value.nil?
45
+ value = instance.instance_eval(default) if value.nil?
46
46
  set_ivar(name, value)
47
47
  end
48
48
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attire
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max White
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-10 00:00:00.000000000 Z
11
+ date: 2015-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec