tco_client_core 0.3.0 → 0.3.1

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: c13303b1d63c373df6e28f468fb5a844b39bd997
4
- data.tar.gz: 9d5d5f9107c31f0794e264c3c4f58fc6b0f8fb42
3
+ metadata.gz: 50e9261a6ff41cbcc4c22eb9aaa1ae8b7ed29706
4
+ data.tar.gz: 47a2e94f04902579cb0cd24006ac3bad7978e40c
5
5
  SHA512:
6
- metadata.gz: 3c76fedbae3fae6f654de6382ca6b91ad80cd3b60766ac181e914a7a22333ad5f1b4e4c3cf234b49d3967c2707b222923b6298f6c95991d84d7e66019ecf7948
7
- data.tar.gz: 1384d6962243cdadfc84b777b9caa7e20321d0f7961f9770e13482b5f0d5a4b7a7fa19e54a7ee047df639ef6b958f199b2cd49e8b95d1cc55ce6f846c2859b88
6
+ metadata.gz: 0fc98374e301461d60b848b2cc83ccaaaacb61c492c199ec564de508aefcb0d50ae78f5138e26192512949399f59f448c62f8944b19ec7a92a1ee7142a08a025
7
+ data.tar.gz: dd1f7ac8ad79d754fb5d16e351ca7c77731d6e61c5a195f92dbd1abfe3ae9a6d39d5c866acc8c93e72710d202237b1e7e32b420c73b182d1a6bab53e6a9b697b
@@ -3,8 +3,9 @@ require "active_model"
3
3
  class TcoClientCore::Model
4
4
  include ActiveModel::Model
5
5
 
6
- def self.new_with_errors attributes, errors
6
+ def self.new_with_errors(attributes, errors)
7
7
  model = new attributes
8
+ return model if errors.nil?
8
9
  errors.each do |key, messages|
9
10
  messages.each do |message|
10
11
  model.errors.add(key.to_sym, message)
@@ -5,6 +5,7 @@ module TcoClientCore
5
5
  extend Forwardable
6
6
 
7
7
  def_delegators :@response, :to_h, :to_hash
8
+ def_delegators :@raw, :to_s, :to_string
8
9
 
9
10
  def initialize(raw)
10
11
  @raw = raw
@@ -1,3 +1,3 @@
1
1
  module TcoClientCore
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tco_client_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - 2CO Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-21 00:00:00.000000000 Z
11
+ date: 2015-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel