manioc 0.1.2 → 0.1.3

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: a438dc71640e6700d5efb85a5973817236dc0990
4
- data.tar.gz: ce5cae5cc25e2e1edf13c08b4bcaadfd7281c264
3
+ metadata.gz: 5ae0a8881a567e6949babdf116daf2750b2b39c5
4
+ data.tar.gz: 7b66abce35066e8cded1810693715f6522291ccd
5
5
  SHA512:
6
- metadata.gz: 99c3852f3e9ab5c68c019bc38f50f9aab951b147e600c5b6755bfcddd3b7c09c70e3a5fb90d65291572e8349ed5325dc54b5bc3c2b21597413dd42b26b70eab3
7
- data.tar.gz: 54741d37eb1808c6785543a0d706494b1307e1780f24bce414f137c5786c0b17e9f8a7fbc3cf1e507a2a7695fbbeab4854a0e683091b95cedaa733e3991a09d1
6
+ metadata.gz: dbc1974df4940e51a88d1b6a7b4e20c4b0b5d2fb93310506986e2dcbb5b9a089d9bdf3181dda3826a5ea780a3f5ef49d2a44e87820cdda848672090fcbbec73a
7
+ data.tar.gz: 2ad4e931946f817dfd5e930fc36f2d33c5e8867d040e3a2f502592755d5dc902863c4b5c4fa71f05713180cef669cf529666944a57ec475525e52e3f17e877a6
@@ -28,17 +28,27 @@ module Manioc
28
28
  def with &block
29
29
  self.class.new \
30
30
  constructors: @constructors.dup,
31
- cache: @cache.any?,
31
+ cache: !@cache.nil?,
32
32
  preload: @preload,
33
33
  &block
34
34
  end
35
35
 
36
+ def clone
37
+ with
38
+ end
39
+
36
40
  def reset key=nil
37
41
  return unless @cache
38
42
  keys = key ? [key] : @cache.keys
39
43
  keys.each { |k| @cache.delete k }
40
44
  end
41
45
 
46
+ def inspect
47
+ # :nocov:
48
+ %|<#{self.class.name}(#{@constructors.keys.join(', ')})>|
49
+ # :nocov:
50
+ end
51
+
42
52
  private
43
53
 
44
54
  def register &block
data/lib/manioc/struct.rb CHANGED
@@ -42,6 +42,12 @@ module Manioc
42
42
  self.class.fields.each_with_object({}) { |field,h| h[field] = public_send field }
43
43
  end
44
44
 
45
+ def inspect
46
+ # :nocov:
47
+ %|<#{self.class.name}(#{self.class.fields.join(', ')})>|
48
+ # :nocov:
49
+ end
50
+
45
51
  private
46
52
 
47
53
  def _validate fields
@@ -1,3 +1,3 @@
1
1
  module Manioc
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: manioc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Dabbs