ciesta 0.2.0 → 0.2.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
  SHA256:
3
- metadata.gz: fa6bcec524ba6b6e11a71bd2fa2852c805f4a2359375a6aeba89fb627a9b8235
4
- data.tar.gz: ee3c19951c78d75b8adc45296277b3610e8fd7ca8c93ea4a99c60bfa2d6d0613
3
+ metadata.gz: 631851224f099bab4b19941f7a13fe52b6e14ed4557941d73e92a6ab2cb64a27
4
+ data.tar.gz: faa312f16a3ad690460902f3c9a979c99cdc9ae3a01fe04166c157e8975732bf
5
5
  SHA512:
6
- metadata.gz: 8780acfc8511f0e275a67643ea470e4150f7c16991b841c17353b39788a892ab3d4716bc56cbfd759cefe81555ba351141e7ce13b5427d0b70a67259824f0adf
7
- data.tar.gz: 7bc5a4bbeb0549e329f11a6f810b2369debf9955d0fa276cd92ac40cf264f5685147362676d344aacd613e4bfa833cc7f5b2de518125f02367ff7e0bf1099861
6
+ metadata.gz: 7ff82210e4debb0cc8bd1a8dc49a37ec0279c0937c69a7b67a5f6e07364f6ba6e9d36779cd5039b44e0eb55cbe8b498c9251aae5d2a36d5c3682f4a191db3d8e
7
+ data.tar.gz: a3c9a73fdf55a1ea35833588cc4c67a8eca06e8335224bc30235231d2301922cb6760df8b7e075fdbd951d8abfb5cd14bb7bf4b9508e5fcfccff00e62a82b391
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ciesta (0.1.1)
4
+ ciesta (0.2.0)
5
5
  dry-types (~> 0.12.1)
6
6
  dry-validation (~> 0.11.1)
7
7
 
@@ -2,7 +2,6 @@
2
2
 
3
3
  # List of object fields
4
4
  #
5
- # @api private
6
5
  # @attr_reader [Hash<Symbol, Ciesta::Field>] list Field list
7
6
  class Ciesta::FieldList
8
7
  # Constructor
@@ -13,12 +12,14 @@ class Ciesta::FieldList
13
12
  # Adds new field to list
14
13
  #
15
14
  # @param [Ciesta::Field] field New field
15
+ # @api private
16
16
  def <<(field)
17
17
  list[field.name] = field
18
18
  end
19
19
 
20
20
  # Getting field by name
21
21
  #
22
+ # @api private
22
23
  # @param [Symbol] name Field name
23
24
  #
24
25
  # @return [Ciesta::Field]
@@ -28,6 +29,7 @@ class Ciesta::FieldList
28
29
 
29
30
  # Setting field value
30
31
  #
32
+ # @api private
31
33
  # @param [Symbol] name Field name
32
34
  # @param [any] value Field value
33
35
  def []=(name, value)
@@ -59,6 +61,7 @@ class Ciesta::FieldList
59
61
 
60
62
  # Getting all field names
61
63
  #
64
+ # @api private
62
65
  # @return [Array<Symbol>]
63
66
  def keys
64
67
  list.keys
@@ -66,6 +69,7 @@ class Ciesta::FieldList
66
69
 
67
70
  # Getting all field values
68
71
  #
72
+ # @api private
69
73
  # @return [Hash<Symbol, any>]
70
74
  def attributes
71
75
  list.values.each_with_object({}) { |field, mem| mem[field.name] = field.value }
@@ -73,6 +77,7 @@ class Ciesta::FieldList
73
77
 
74
78
  # Iterate over all fields
75
79
  #
80
+ # @api private
76
81
  # @param [Block] block Block to iterate
77
82
  def each
78
83
  list.each { |name, field| yield(name, field.value) }
@@ -2,12 +2,12 @@
2
2
 
3
3
  # Class for syncing fields and object
4
4
  #
5
- # @api private
6
5
  # @attr_reader [Object] object Form objecy
7
6
  # @attr_reader [Ciesta::FieldList] fields Field list
8
7
  class Ciesta::Syncer
9
8
  # Constructor
10
9
  #
10
+ # @api private
11
11
  # @param [Object] object Form objecr
12
12
  # @param [Ciesta::FieldList] fields Field list
13
13
  def initialize(object, fields)
@@ -2,7 +2,6 @@
2
2
 
3
3
  # Validatior class for form
4
4
  #
5
- # @api private
6
5
  # @attr_reader [Dry::Validation::Schema] schema Schema for validation
7
6
  # @attr_reader [Hash] errors Array with errors
8
7
  class Ciesta::Validator
@@ -15,6 +14,7 @@ class Ciesta::Validator
15
14
 
16
15
  # Set schema for validation
17
16
  #
17
+ # @api private
18
18
  # @param [Block] block Block wich returns the schema
19
19
  def use(&block)
20
20
  @schema = Dry::Validation.Form(&block)
@@ -24,6 +24,7 @@ class Ciesta::Validator
24
24
  #
25
25
  # @param [Hash<Symbol, any>] attributes Attributes to check
26
26
  #
27
+ # @api private
27
28
  # @return [Boolean]
28
29
  def valid?(attributes)
29
30
  return true if schema.nil?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ciesta
4
- VERSION = "0.2.0".freeze
4
+ VERSION = "0.2.1".freeze
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ciesta
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexey