morf 0.0.1 → 0.0.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: 946b8a0940f00a90e751212769a15915f69d0ea4
4
- data.tar.gz: 0c5bc2171fcfc37ab7af826cfa5fb7a5e6decf0e
3
+ metadata.gz: 1d1ca658d7ecfe2fca6700703b1f49bae588a600
4
+ data.tar.gz: fdbdaa26268cf46270dcccbaee9a2336fcfa1aac
5
5
  SHA512:
6
- metadata.gz: b14c86eb318d49676e10f343d569a8ae5254fb092c7cf0415b02bbf588a31e1e0a231cae94425a4e711448773f081b86e1b72a628b80ac5f46ee6bd2bc879e59
7
- data.tar.gz: 2f693a3dd1720b810093bfc7657ef1a6b26973fed1fed2f636d13ba98d5bc3752a2512da5d9e32402babc8cf2debf53e9f4c94eb7c8e7ab4c26aca760e051ca9
6
+ metadata.gz: 23e24a7735c42f6dd473227afa003078b08b35ea96c2b6ac389abcaff64b4dd198377e5f93f454087ff557279f6efca73725be12f9feabd455d2d20bda376949
7
+ data.tar.gz: 6888c505390023f788027668f79082d56e203e5e930ed033f2def5c5dd7ee7f697bc44a7cd7feeab1ff29ce01db89e8bb8326af392f0c5b333a5aacf8ee1adeb
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- v (0.0.1)
4
+ morf (0.0.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -29,9 +29,9 @@ PLATFORMS
29
29
  DEPENDENCIES
30
30
  activesupport (~> 1.3)
31
31
  bundler (~> 1.3)
32
+ morf!
32
33
  rake
33
34
  rspec
34
- v!
35
35
 
36
36
  BUNDLED WITH
37
37
  1.15.4
@@ -1,11 +1,5 @@
1
1
  class Morf::Casters::StringCaster
2
2
  def self.cast(value, attr_name, options = {})
3
- if value.is_a?(String)
4
- value
5
- elsif value.is_a?(Symbol)
6
- value.to_s
7
- else
8
- raise Morf::Errors::CastingError, "should be a string"
9
- end
3
+ value.to_s
10
4
  end
11
5
  end
data/lib/morf/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Morf
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -134,7 +134,7 @@ describe Morf::Caster do
134
134
  input_hash = {
135
135
  contact: {
136
136
  name: {},
137
- age: 22,
137
+ age: 'aaa',
138
138
  weight: 65.5,
139
139
  birthday: Date.today,
140
140
  last_logged_in: DateTime.now,
@@ -158,7 +158,7 @@ describe Morf::Caster do
158
158
 
159
159
  expect do
160
160
  ContactCaster.cast(input_hash)
161
- end.to raise_error(Morf::Errors::CastingError, "contact[name] should be a string")
161
+ end.to raise_error(Morf::Errors::CastingError, "contact[age] is invalid integer")
162
162
  end
163
163
 
164
164
  it "should raise error if some attribute wasn't given" do
@@ -376,9 +376,9 @@ describe Morf::Caster do
376
376
  expect do
377
377
  HomeCaster.cast(
378
378
  city: nil,
379
- zip: nil
379
+ zip: 'nil'
380
380
  )
381
- end.to raise_error(Morf::Errors::CastingError, "city should be a string")
381
+ end.to raise_error(Morf::Errors::CastingError, "zip is invalid integer")
382
382
  end
383
383
  end
384
384
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: morf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Droid Labs LLC