frenchy 0.2.5 → 0.2.6

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: 079b65af1cc7e83657a259c7c354b56fffbb74bf
4
- data.tar.gz: bef2547373688fed01688bf1896e1eefe0bd21f3
3
+ metadata.gz: 4b87c18d424750ac80d153e0dfc11fae1a27d835
4
+ data.tar.gz: dfef868e271f1346e30e1b38e9a3083f04aa1e67
5
5
  SHA512:
6
- metadata.gz: 18b3566cea38658d57b0e25693af7f29d049a848aa2c07ca75fe8a32af47446f09933526b541f4ab75caa8994f32b53a9fdaa491d2dc99ba2342480307efb8fd
7
- data.tar.gz: 1a98a8c76f6b0ad72196bccda720027818fc649043aeb53711c452a3fb6fc510e951f058e87b9ed73747ab19c4cdc1b0c6a4349bbe013cd34a06b882d40d5a67
6
+ metadata.gz: f32f3a1a9f63ffc28225bfe482992f061ed74a1707fd06b6ccd36fef052650907f406fa6d081e9ed0d7c257286295f23fd73e81f1ff403e83cf7b7a884c07111
7
+ data.tar.gz: f6628b1bd1b7e1994fa1bbd012db4e2cb491b9b12a4a8bd97e3f23c8230af13dca3ddb310c7733d580b83fdf5744ee8181fb383780dce1bf1b81f6d40b54b696
@@ -26,6 +26,16 @@ module Frenchy
26
26
  Hash[self.class.fields.map {|k,_| [k, send(k)]}]
27
27
  end
28
28
 
29
+ # Returns a copy of the model
30
+ def to_model
31
+ self
32
+ end
33
+
34
+ # Returns that the model is persisted
35
+ def persisted?
36
+ true
37
+ end
38
+
29
39
  # Return a string representing the value of the model instance
30
40
  def inspect
31
41
  "<#{self.class.name} #{attributes.map {|k,v| "#{k}: #{v.inspect}"}.join(", ")}>"
@@ -1,3 +1,3 @@
1
1
  module Frenchy
2
- VERSION = "0.2.5"
2
+ VERSION = "0.2.6"
3
3
  end
@@ -65,6 +65,20 @@ describe Frenchy::Model do
65
65
  end
66
66
  end
67
67
 
68
+ describe "#to_model" do
69
+ it "returns itself" do
70
+ model = SimpleModel.new(id: 1)
71
+ expect(model.to_model).to eq(model)
72
+ end
73
+ end
74
+
75
+ describe "#persisted?" do
76
+ it "returns true" do
77
+ model = SimpleModel.new(id: 1)
78
+ expect(model.persisted?).to eq(true)
79
+ end
80
+ end
81
+
68
82
  describe "#decorate" do
69
83
  it "decorates the model using the named convention" do
70
84
  model = SimpleModel.new
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frenchy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Coene
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-27 00:00:00.000000000 Z
11
+ date: 2014-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -179,7 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
179
179
  version: '0'
180
180
  requirements: []
181
181
  rubyforge_project:
182
- rubygems_version: 2.2.0
182
+ rubygems_version: 2.2.2
183
183
  signing_key:
184
184
  specification_version: 4
185
185
  summary: Opinionated JSON API modeling framework for Ruby.