accessory 0.1.7 → 0.1.8

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
  SHA256:
3
- metadata.gz: 9f4517af7f1ae501a9dea6721f8dd0966a85c2fd9e8ada3d1d444f8b58cb297e
4
- data.tar.gz: 4e8bcc0130b9cb5078779642cc0e81f4d4121ac6275ead2fe7a5decd873a5047
3
+ metadata.gz: bad93b39fc1164c938ed170896bfc5d6ef0c7d157a443b05395ef835fcaf6706
4
+ data.tar.gz: ac0cdef27d42a339c3b640ee06c8231f4e724b2b2e541eb081bc37d33542fa35
5
5
  SHA512:
6
- metadata.gz: 295b43b1f100522c1dcc9e659acbcf174a9725c38448d68b8eb3be10603b9ad9df643f82dced994849616d194ccef080697febc3f934440b45420eae8229fa31
7
- data.tar.gz: 5d9d93d0a17668ba39313dd8151cf7324a562df362fbbeb0a34bdc6c24b2dc7a8996f36f8e0b1be1c0d489dafc435f645e1b8a4348e3a080bdd66e9efe5dbc61
6
+ metadata.gz: ae8c4170a783795b4e436232f1051c7bd3b0ef39132af63fcc0055c27df97eaabcd981f00a338f38bf0a343a582e30db1dc7b2cc4026f07d8dfa93d47177df8c
7
+ data.tar.gz: f78e0b73341624deb56871906d2dc33e5791a7514f3c6bd9f3db955c6f7e09e95621827d9a7978ec21f5fb7ff1fbbad764feb271e676525e957355e7dd7b6fe1
@@ -134,7 +134,8 @@ class Accessory::Accessor
134
134
  # of the +get_result+s should replicate the data flow of {get}.
135
135
  # * the +new_value+ should be used to *replace* or *overwrite* the result of
136
136
  # this accessor's traversal within +data+. For example, in
137
- # {SubscriptAccessor}, <tt>data[key] = new_value</tt> is executed.
137
+ # {Accessors::SubscriptAccessor}, <tt>data[key] = new_value</tt> is
138
+ # executed.
138
139
  #
139
140
  # In the <tt>:pop</tt> command case:
140
141
  # * the result of the traversal (*before* the yield) should be returned. This
@@ -142,7 +143,7 @@ class Accessory::Accessor
142
143
  # traversal-results before feeding them into yield, in order to return them
143
144
  # here.
144
145
  # * the traversal-result should be *removed* from +data+. For example, in
145
- # {SubscriptAccessor}, <tt>data.delete(key)</tt> is executed.
146
+ # {Accessors::SubscriptAccessor}, <tt>data.delete(key)</tt> is executed.
146
147
  #
147
148
  # The successor in the accessor chain will receive the yielded
148
149
  # traversal-results as its own +data+.
@@ -195,9 +196,9 @@ class Accessory::Accessor
195
196
  #
196
197
  #
197
198
  # For example, if your accessor operates on +Enumerable+ values (like
198
- # {AllAccessor}), then this method should validate that the +traversal_result+
199
- # is +Enumerable+; and, if it isn't, return something that is — e.g. an empty
200
- # +Array+.
199
+ # {Accessors::AllAccessor}), then this method should validate that the
200
+ # +traversal_result+ is +Enumerable+; and, if it isn't, return something that
201
+ # is — e.g. an empty +Array+.
201
202
  #
202
203
  # This logic is used to replace invalid intermediate values (e.g. `nil`s and
203
204
  # scalars) with containers during {Lens#put_in} et al.
@@ -8,8 +8,8 @@ require 'accessory/accessor'
8
8
  # the getter/setter pair <tt>.foo</tt> and <tt>.foo=</tt>.
9
9
  #
10
10
  # The abstract "attribute" does not have to correspond to an actual
11
- # +attr_accessor+; the {AttributeAccessor} will work as long as the relevant
12
- # named getter/setter methods exist on the receiver.
11
+ # +attr_accessor+; the AttributeAccessor will work as long as the
12
+ # relevant named getter/setter methods exist on the receiver.
13
13
  #
14
14
  # *Aliases*
15
15
  # * {Access.attr}
@@ -5,7 +5,7 @@ require 'accessory/traversal_position/enumerable_before_offset'
5
5
  # Traverses the positions "between" the elements of an +Enumerable+, including
6
6
  # the positions at the "edges" (i.e. before the first, and after the last.)
7
7
  #
8
- # {BetweenEachAccessor} can be used with {Lens#put_in} to insert new
8
+ # BetweenEachAccessor can be used with {Lens#put_in} to insert new
9
9
  # elements into an Enumerable between the existing ones.
10
10
  #
11
11
  # *Aliases*
@@ -13,10 +13,11 @@ require 'accessory/traversal_position/enumerable_before_offset'
13
13
  # The +offset+ in this accessor has equivalent semantics to the offset in
14
14
  # <tt>Array#insert(offset, obj)</tt>.
15
15
  #
16
- # {BetwixtAccessor} can be used with {Lens#put_in} to insert new
16
+ # {Accessors::BetwixtAccessor} can be used with {Lens#put_in} to insert new
17
17
  # elements into an Enumerable between the existing ones. If you want to extend
18
18
  # an +Enumerable+ as you would with <tt>#push</tt> or <tt>#unshift</tt>, this
19
- # accessor will have better behavior than using {SubscriptAccessor} would.
19
+ # accessor will have better behavior than using {Accessors::SubscriptAccessor}
20
+ # would.
20
21
  #
21
22
  # *Aliases*
22
23
  # * {Access.betwixt}
@@ -4,8 +4,8 @@ require 'accessory/accessor'
4
4
  # Traverses into the "first" element within an +Enumerable+, using
5
5
  # <tt>#first</tt>.
6
6
  #
7
- # This accessor can be preferable to {SubscriptAccessor} for objects that
8
- # are not subscriptable, e.g. {Range}.
7
+ # This accessor can be preferable to {Accessors::SubscriptAccessor} for objects
8
+ # that are not subscriptable, e.g. +Range+.
9
9
  #
10
10
  # *Aliases*
11
11
  # * {Access.first}
@@ -4,8 +4,8 @@ require 'accessory/accessor'
4
4
  # Traverses into the "last" element within an +Enumerable+, using
5
5
  # <tt>#last</tt>.
6
6
  #
7
- # This accessor can be preferable to {SubscriptAccessor} for objects that
8
- # are not subscriptable, e.g. {Range}.
7
+ # This accessor can be preferable to {Accessors::SubscriptAccessor} for objects
8
+ # that are not subscriptable, e.g. +Range+.
9
9
  #
10
10
  # *Aliases*
11
11
  # * {Access.last}
@@ -29,7 +29,7 @@ require 'accessory/accessor'
29
29
  # # default-constructs a Hash, not an Array
30
30
  # [].lens[0][0].put_in(1) # => [{0=>1}]
31
31
  #
32
- # Other accessors ({FirstAccessor}, {BetwixtAccessor}, etc.) may fit your expectations more closely for +Array+ traversal.
32
+ # Other accessors ({Accessors::FirstAccessor}, {Accessors::BetwixtAccessor}, etc.) may fit your expectations more closely for +Array+ traversal.
33
33
 
34
34
  class Accessory::Accessors::SubscriptAccessor < Accessory::Accessor
35
35
  # @!visibility private
@@ -164,7 +164,7 @@ class Accessory::Lens
164
164
  # 1. the _old_ value(s) found after all traversals, and
165
165
  # 2. the updated +subject+
166
166
  def update_in(subject, &new_value_fn)
167
- _, new_data = self.get_and_update_in(data){ |v| [nil, new_value_fn.call(v)] }
167
+ _, new_data = self.get_and_update_in(subject){ |v| [nil, new_value_fn.call(v)] }
168
168
  new_data
169
169
  end
170
170
 
@@ -1,3 +1,3 @@
1
1
  module Accessory
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: accessory
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Levi Aul