ciesta 0.2.4 → 0.2.5

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
  SHA256:
3
- metadata.gz: bb2964e90401b855dc16d22aaa8f33634a4994080ec94b4db9a52f8cd3a6a519
4
- data.tar.gz: 80631e5019a4e21759777edb3aaf70429699533a278ecad419d1c09ae11fe9c1
3
+ metadata.gz: 656823f7c7c09fca1aecc228d110781b19bac2bc0fe51dd67256f85204fbb9eb
4
+ data.tar.gz: 2891c4aec116941b7adba933214a6558eb9a19f9faf23ac98391e011b793a232
5
5
  SHA512:
6
- metadata.gz: 7c752c91de5d1a7d8f0d284193f19b61dbd76666ed013e1dc83f5ce597849636153fc3151c405dbe37e1635d5acb5f354c3ab9ed6d7580beb78270ed1497eac8
7
- data.tar.gz: ea33aa1779f0bcb4d79df9c3218c3302113f111d9417dadec5d0e8171859006a0f3d24a4dbd943f9405bc6dae26c27d5fc56db52c973e4d2440c5e11a62118cc
6
+ metadata.gz: abfa59c30e273e11e8c8b2ad3bd824f4dc77ae3e746e1eaf29fcf88ac1d397c8236e1ed6febebd2c7c232092bb0085db281a710b26b0b1752fb3125e38a101de
7
+ data.tar.gz: 1686a2b5e13f86a33df36f7a76a3b500ad91f05d216475e8292fcb11c01b6aa0905c1b1d5ace9660d1470c847967b2b07a844450c0c7e6361736e1b3ebd7c037
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ciesta (0.2.4)
4
+ ciesta (0.2.5)
5
5
  dry-types (~> 0.12.1)
6
6
  dry-validation (~> 0.11.1)
7
7
 
@@ -50,7 +50,7 @@ GEM
50
50
  json (2.1.0)
51
51
  method_source (0.9.0)
52
52
  parallel (1.12.1)
53
- parser (2.5.0.4)
53
+ parser (2.5.1.0)
54
54
  ast (~> 2.4.0)
55
55
  powerpack (0.1.1)
56
56
  pry (0.11.3)
@@ -71,7 +71,7 @@ GEM
71
71
  diff-lcs (>= 1.2.0, < 2.0)
72
72
  rspec-support (~> 3.7.0)
73
73
  rspec-support (3.7.1)
74
- rubocop (0.54.0)
74
+ rubocop (0.55.0)
75
75
  parallel (~> 1.10)
76
76
  parser (>= 2.5)
77
77
  powerpack (~> 0.1)
@@ -88,7 +88,7 @@ GEM
88
88
  tins (~> 1.0)
89
89
  thor (0.19.4)
90
90
  tins (1.16.3)
91
- unicode-display_width (1.3.0)
91
+ unicode-display_width (1.3.2)
92
92
 
93
93
  PLATFORMS
94
94
  ruby
@@ -61,6 +61,11 @@ class Ciesta::Field
61
61
  @virtual
62
62
  end
63
63
 
64
+ # Clear field
65
+ def clear!
66
+ @value = nil
67
+ end
68
+
64
69
  private
65
70
 
66
71
  # Returns typed default value for field
@@ -87,6 +87,13 @@ class Ciesta::FieldList
87
87
  list.each_value { |field| yield(field) }
88
88
  end
89
89
 
90
+ # Clear all fields
91
+ #
92
+ # @api private
93
+ def clear!
94
+ list.each_value(&:clear!)
95
+ end
96
+
90
97
  private
91
98
 
92
99
  attr_reader :list
@@ -10,7 +10,7 @@ class Ciesta::Form
10
10
  # @!method assign!
11
11
  # @!method attributes
12
12
  # @see Ciesta::FieldList
13
- delegate :assign, :assign!, :attributes, to: :fields
13
+ delegate :assign, :assign!, :attributes, :clear!, to: :fields
14
14
 
15
15
  # @!method errors
16
16
  # @see Ciesta::Validator
@@ -67,6 +67,7 @@ class Ciesta::Form
67
67
  # @param [Object] object Object wich will be updated though this form
68
68
  def initialize(object = nil)
69
69
  @object = object
70
+ clear!
70
71
 
71
72
  return if object.nil?
72
73
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ciesta
4
- VERSION = "0.2.4".freeze
4
+ VERSION = "0.2.5".freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ciesta
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexey
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-22 00:00:00.000000000 Z
11
+ date: 2018-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-types
@@ -173,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
173
  version: '0'
174
174
  requirements: []
175
175
  rubyforge_project:
176
- rubygems_version: 2.7.3
176
+ rubygems_version: 2.7.6
177
177
  signing_key:
178
178
  specification_version: 4
179
179
  summary: Create form objects easy