cistern 0.5.7 → 0.5.8
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 +4 -4
- data/lib/cistern/attributes.rb +4 -0
- data/lib/cistern/version.rb +1 -1
- data/spec/model_spec.rb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42aadc8d27a58a072c8338e1e575e03e2d17b20f
|
4
|
+
data.tar.gz: 41510985135dbe04bd392882acf61c24d86333c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86c4634fd7ca6824279227821a7f5336a37bfc01f28bf2bc8bf583b74b0ecaba27b963d1e6d7f4523701d8a5a6a75e09831dc3653b2ea01f29dd5544dfaa528b
|
7
|
+
data.tar.gz: c1a09a5a40070f4a373acdd2edebceb0e24673653024b439d4c049c00e77a439e8098f3f3ccf429a79d2fae47f066fbe2e1ebd9dfb6aa3509a4b74f9daac5078
|
data/lib/cistern/attributes.rb
CHANGED
@@ -83,6 +83,10 @@ module Cistern::Attributes
|
|
83
83
|
attributes[name.to_s.to_sym]
|
84
84
|
end
|
85
85
|
|
86
|
+
if options[:type] == :boolean
|
87
|
+
self.send(:alias_method, "#{name}?", name)
|
88
|
+
end
|
89
|
+
|
86
90
|
self.send(:define_method, "#{name}=") do |value|
|
87
91
|
transformed = transform.call(name, value, options)
|
88
92
|
attributes[name.to_s.to_sym]= parser.call(transformed, options)
|
data/lib/cistern/version.rb
CHANGED
data/spec/model_spec.rb
CHANGED
@@ -66,6 +66,8 @@ describe "Cistern::Model" do
|
|
66
66
|
TypeSpec.new(flag: "1").flag.should be_true
|
67
67
|
TypeSpec.new(flag: 0).flag.should be_false
|
68
68
|
TypeSpec.new(flag: 1).flag.should be_true
|
69
|
+
TypeSpec.new(flag: false).should_not be_flag
|
70
|
+
TypeSpec.new(flag: true).should be_flag
|
69
71
|
end
|
70
72
|
|
71
73
|
it "should parse an array" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cistern
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Lane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: API client framework extracted from Fog
|
14
14
|
email:
|