reorm 0.1.1 → 0.1.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
  SHA1:
3
- metadata.gz: b8e2625b170999be3b178611122ec2353797b453
4
- data.tar.gz: 70746fd3ab31c1a14ea5d9c57494b22f11c6ff3e
3
+ metadata.gz: 349b42b82a65b2182cbb0d4e22ead28a3009c8c4
4
+ data.tar.gz: 69773c3cf634e58f0bde246101027d01876ecfec
5
5
  SHA512:
6
- metadata.gz: 764c1dbc2153fa85b6e27697a3683d4095506942444b86ee60017f362f3233bfedacd0277bbd91d68ce9dca95eb07dccfb8566d7a3e005afc69165bbb881b25b
7
- data.tar.gz: 2fad70403611ab22870ac4167dda6b93c3573f0fc5befc8d3d1f89e947616f1952f6ccd275c442bbfedabc43876e1643664c9058ee5004410abdf545df4593bc
6
+ metadata.gz: 4c999d7600d72b61f1b1462a87ef3dd19a5a284c7c580a77f3c0fdb08a0121b87aa01250ae30e104813352c33d5a453deb7be664e496e7d6e6eb906244fc47a9
7
+ data.tar.gz: 3390fb660e114daa2287541d0f04335a80c0958703b8c75141dcf0289f91ac166483fd9afca6ea5a2bebae1a6901be773596dd7ddaa89dad8b8b80d5198cc4a5
data/lib/reorm/model.rb CHANGED
@@ -83,7 +83,7 @@ module Reorm
83
83
  end
84
84
 
85
85
  def respond_to?(method_name, include_private=false)
86
- @properties.include?(property_name(method_name)) || super
86
+ method_name.to_s[-1, 1] == "=" || @properties.include?(property_name(method_name)) || super
87
87
  end
88
88
 
89
89
  def method_missing(method_name, *arguments, &block)
data/lib/reorm/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Reorm
2
2
  MAJOR_VERSION = 0
3
3
  MINOR_VERSION = 1
4
- BUILD_VERSION = 1
4
+ BUILD_VERSION = 2
5
5
  VERSION = "#{MAJOR_VERSION}.#{MINOR_VERSION}.#{BUILD_VERSION}"
6
6
  end
@@ -84,6 +84,33 @@ describe Reorm::Model do
84
84
  end
85
85
  end
86
86
 
87
+ describe "model properties" do
88
+ subject {
89
+ SetterTestModel.new(existing_value: 1234)
90
+ }
91
+
92
+ it "makes top level values available as model properties" do
93
+ expect(subject[:existing_value]).to eq(1234)
94
+ expect(subject.existing_value).to eq(1234)
95
+ end
96
+
97
+ describe "assignment of a previously non-existent property" do
98
+ it "assigns the property the specified value" do
99
+ subject.new_value = "Text."
100
+ expect(subject[:new_value]).to eq("Text.")
101
+ expect(subject.new_value).to eq("Text.")
102
+ end
103
+ end
104
+
105
+ describe "assignment of an existing property" do
106
+ it "updates the values setting" do
107
+ subject.existing_value = "Changed!"
108
+ expect(subject[:existing_value]).to eq("Changed!")
109
+ expect(subject.existing_value).to eq("Changed!")
110
+ end
111
+ end
112
+ end
113
+
87
114
  describe "#valid?()" do
88
115
  subject {
89
116
  ValidationTestModel.new
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reorm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Wood
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-07 00:00:00.000000000 Z
11
+ date: 2015-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler