poros 0.2.1 → 0.2.2

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
  SHA256:
3
- metadata.gz: 73a30daa683b2b3f91f9c1145d8a2c663431789e96c5007f1b768358dc984490
4
- data.tar.gz: bb1a9241edf4c85b0b5029f5a8aedb9f5dc19338ea65bfdbe179c0087654f961
3
+ metadata.gz: e7ec142e948b6710c081338f06724f8563917a217fa8f87311114e51eed3bcc9
4
+ data.tar.gz: adc6edc71a8151feb56cd5ceb642d973afc9c160d1ce90d7afb7d535332b45df
5
5
  SHA512:
6
- metadata.gz: d4dc72766c3e755d7d8f60a28b9df09ee0dcd9caba027fb1d518daf796e9a9a2afe99b940b1876358e3712b5aad6e275e3b0450c9a10e34dd737195ccb032fe0
7
- data.tar.gz: d0b24230f41db3041e993b52a79c52fdc4971024b259fb6b95f934924b8d116bca73ebea5f65cbee55021a3714938b8ae86c50e609177503003124a41da961dc
6
+ metadata.gz: 41f991b29ee7c2e91e959a07c87d2e5fefe296c1467db50adfb586710656b29a9963aa97d631c8b479a5c89e2e58f72e2cb19bd0278020d1c1ef59b96a50044d
7
+ data.tar.gz: 02f9a28651945c27e73564a1d9d003503e3336f771c18706dd3a9de23fd458d40c5d013a2dfe2b4f34f2a6f3c84909d88e20a59ecb464a2abfc3504f78e3da50
data/README.md CHANGED
@@ -63,8 +63,21 @@ save to the default of `./db/#{self}`. If you do re-define it you _must_
63
63
  seperate each model into it's own folder or it will have _lots_ of issues.
64
64
 
65
65
  `.where` acts a bit like ActiveRecord but it's not currently chainable (I plan
66
- to do that in the future though) and currently can only take exact matches or
67
- regex, I plan to add array in the near future.
66
+ to do that in the future though) and takes exact matches, regexs, arrays, or
67
+ lambdas in any combination.
68
+
69
+ ```ruby
70
+ # Valid examples
71
+ Widget.where(name: 'sprocket')
72
+ Widget.where(name: /spr.*cket/)
73
+ Widget.where(order: -> value { value > 3 })
74
+ Widget.where(order: [1, 5, 8], active: true)
75
+
76
+ # Invalid examples
77
+ Widget.where(name: 'sprocket', name: 'cog') # can't check same value twice, use arrays
78
+ Widget.where(order: 1).where(name: 'cog') # can't chain wheres
79
+ ```
80
+
68
81
 
69
82
  `.find` takes the `#uuid` which is generated by Poros and returns the single record.
70
83
 
data/lib/poros/info.rb CHANGED
@@ -1,16 +1,18 @@
1
- class Poros::Info
2
- def initialize(object)
3
- @object = object
4
- end
1
+ module Poros
2
+ class Info
3
+ def initialize(object)
4
+ @object = object
5
+ end
5
6
 
6
- def file_path
7
- @object.class.file_path(@object.uuid)
8
- end
7
+ def file_path
8
+ @object.class.file_path(@object.uuid)
9
+ end
9
10
 
10
- def to_h
11
- @object.class.poro_attrs.map { |column|
12
- [column, @object.send(column.to_s)]
13
- }.to_h
11
+ def to_h
12
+ @object.class.poro_attrs.map { |column|
13
+ [column, @object.send(column.to_s)]
14
+ }.to_h
15
+ end
14
16
  end
15
17
  end
16
18
 
data/lib/poros/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Poros
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: poros
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Ross Earle