cistern 0.5.7 → 0.5.8

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: 9db40e93bb01c7cf0fd8c04ae34fc87d1c90ec7a
4
- data.tar.gz: bc3dce9fd3632ee078fe99e716ab8af79a26a7ff
3
+ metadata.gz: 42aadc8d27a58a072c8338e1e575e03e2d17b20f
4
+ data.tar.gz: 41510985135dbe04bd392882acf61c24d86333c7
5
5
  SHA512:
6
- metadata.gz: ae821dfb3d91a24edb3e268c7647df00a24e6aa5628592ed311ab97fa3ea90808cc777de0cb98adabcf3dd86bc6e13e8fd2a4e107db55d68868cfae198455cc8
7
- data.tar.gz: 90a80c9f6ed3a56fe979b9304ec3a82843d0b1984d0bff9bfc6ed9a3b4f1c708a01c78ef2b2f00f02f2f3f46e6e3c061b1c4e8a3615ca614da343a0fda5f44e3
6
+ metadata.gz: 86c4634fd7ca6824279227821a7f5336a37bfc01f28bf2bc8bf583b74b0ecaba27b963d1e6d7f4523701d8a5a6a75e09831dc3653b2ea01f29dd5544dfaa528b
7
+ data.tar.gz: c1a09a5a40070f4a373acdd2edebceb0e24673653024b439d4c049c00e77a439e8098f3f3ccf429a79d2fae47f066fbe2e1ebd9dfb6aa3509a4b74f9daac5078
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module Cistern
2
- VERSION = "0.5.7"
2
+ VERSION = "0.5.8"
3
3
  end
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.7
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-03 00:00:00.000000000 Z
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: