skn_utils 3.3.9 → 3.3.10

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: a858152ce4dbee2e8d75935809054ce1794e4865
4
- data.tar.gz: 81d7e5210977626a919d06b9f43dee354f44e85c
3
+ metadata.gz: 0e0888077b5af6a475d4b67bf2793dc9ca38258c
4
+ data.tar.gz: 45ac9071cd4c71c4786ab0f2ee81399d339b495e
5
5
  SHA512:
6
- metadata.gz: 31c5cfda536c02ac7a783fc7f9bf45d1bb0f098b5acee96a30ec4312a0121151de5e6886d6d70f0df337f3a09603c634c9fe2ffb11b4283530d3b0c0013dd1a9
7
- data.tar.gz: fe52c36f44ad71a09e9d5ea5aac0e973f9c6eabf2b15d7f0b19a98495a5933b8ecba476c172a6646cf33f85378b918ee0ccfe2084be04b9393b724bd139c4222
6
+ metadata.gz: 1f37a9eeb506d09fe7c3dc9cb878b843770be0046942f522326285b660522b9114dc9d098a2d76fab26407d2fdb2c80269821df4294dc33a41d0a23bfd436672
7
+ data.tar.gz: de4b74eec5a97c63b6327d6ef66cba16835e32b7f30fffa26a87597bda7a983283306180528d00fb80b0d9b4f0f1f47db2a79f80b3b4d704370621c098efc8fe
data/README.md CHANGED
@@ -90,6 +90,7 @@ Ruby Gem containing a Ruby PORO (Plain Old Ruby Object) that can be instantiated
90
90
  #to_a -- returns Array of each value in the list
91
91
 
92
92
  State
93
+ #node -- returns the current node (LinkedNode class)
93
94
  #clear -- removes all elements and return number of elements removed
94
95
  #empty? -- returns true if list has no elements, otherwise false
95
96
  #size -- returns total count of elements in the list
@@ -133,9 +134,9 @@ Ruby Gem containing a Ruby PORO (Plain Old Ruby Object) that can be instantiated
133
134
 
134
135
  Initialization: optional &block to identify data key
135
136
 
136
- #call(*vargs, &block) -- Instansiates new list and optionally creates nodes from each comma-seperated value;
137
+ #call(*vargs, &block) -- Instansiates new list and creates nodes from each comma-seperated value;
137
138
  also, assigns &block as default value identifier for find and sort operations
138
- returns the first node when initialized with vargs -- else class instance
139
+ returns the first node -- else class instance
139
140
  compare_key_block example: node = LinkedList.call({:key=>"Z"},{:key=>"S"},{:key=>"N"}) {|a| a[:key]}
140
141
 
141
142
 
@@ -73,7 +73,7 @@ module SknUtils
73
73
  # return new size
74
74
  def insert(value)
75
75
  node = @current
76
- @current = LinkNode.new(value, node, :circle_after, self, &@match_value)
76
+ @current = LinkNode.call(value, node, :circle_after, self, &@match_value)
77
77
  if self.size == 0 # only
78
78
  self.head = @current
79
79
  self.tail = @current
@@ -89,7 +89,7 @@ module SknUtils
89
89
  # return new size
90
90
  def insert_before(position_value, value)
91
91
  target = find_by_value(position_value)
92
- node = LinkNode.new(value, target, :circle_before, self, &@match_value)
92
+ node = LinkNode.call(value, target, :circle_before, self, &@match_value)
93
93
  @current = node
94
94
  if self.size == 0 # only
95
95
  self.head = node
@@ -105,7 +105,7 @@ module SknUtils
105
105
  # return new size
106
106
  def insert_after(position_value, value)
107
107
  target = find_by_value(position_value)
108
- node = LinkNode.new(value, target, :circle_after, self, &@match_value)
108
+ node = LinkNode.call(value, target, :circle_after, self, &@match_value)
109
109
  @current = node
110
110
  if self.size == 0 # only
111
111
  self.head = node
@@ -71,7 +71,7 @@ module SknUtils
71
71
  # return new size
72
72
  def insert(value)
73
73
  node = @current
74
- @current = LinkNode.new(value, node, :after, self, &@match_value)
74
+ @current = LinkNode.call(value, node, :after, self, &@match_value)
75
75
  self.head = @current if self.head.nil?
76
76
  self.tail = @current if self.tail.equal?(node)
77
77
  self.size += 1
@@ -81,7 +81,7 @@ module SknUtils
81
81
  # return new size
82
82
  def insert_before(position_value, value)
83
83
  target = find_by_value(position_value)
84
- node = LinkNode.new(value, target, :before, self, &@match_value)
84
+ node = LinkNode.call(value, target, :before, self, &@match_value)
85
85
  @current = node if target
86
86
  self.head = node if self.head.equal?(target)
87
87
  self.tail = node if self.tail.nil?
@@ -91,7 +91,7 @@ module SknUtils
91
91
  # return new size
92
92
  def insert_after(position_value, value)
93
93
  target = find_by_value(position_value)
94
- node = LinkNode.new(value, target, :after, self, &@match_value)
94
+ node = LinkNode.call(value, target, :after, self, &@match_value)
95
95
  @current = node
96
96
  self.head = node if self.head.nil?
97
97
  self.tail = node if self.tail.equal?(target)
@@ -40,6 +40,10 @@ module SknUtils
40
40
  # Navigation
41
41
  #
42
42
 
43
+ def node
44
+ @current
45
+ end
46
+
43
47
  # +int position from current node
44
48
  def nth(index)
45
49
  node = @current
@@ -3,7 +3,7 @@ module SknUtils
3
3
  class Version
4
4
  MAJOR = 3
5
5
  MINOR = 3
6
- PATCH = 9
6
+ PATCH = 10
7
7
 
8
8
  def self.to_s
9
9
  [MAJOR, MINOR, PATCH].join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skn_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.9
4
+ version: 3.3.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Scott Jr