vector_salad 0.0.3 → 0.0.4

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: 7083ae78be257690b2c622f111ef364f95096608
4
- data.tar.gz: 935c635c99950f0082ebe29321ee72b346adc658
3
+ metadata.gz: 4097a322261edfff741d8aa066a56c83be69642e
4
+ data.tar.gz: f48ee96bc523a4330261964a61a6ac5ee406693b
5
5
  SHA512:
6
- metadata.gz: f388ec008c53ca10f4b2dd9c2df1d65f784b743d63bfffe4a561f94f207d20e918fefe2a69f967562827e6766d4a00321afa9afe47cca186617da28aab1c33d5
7
- data.tar.gz: 8c948e79ebe414f3c20f0d1bdd91bceb9664428fd986136e28d35119158503d1134ece6be711f9d41cfbe1b26a44b29c3bc5e1f2422d326c6572f5c4d60dadee
6
+ metadata.gz: 22d9ca644aa04779c84f9782e8af5d890f24e83043b895d620a71a02f6d1e831f0dbc2642775ada308654966e7b7236c04b1816f766c70da76d0860e124d3dfe
7
+ data.tar.gz: fdaa447881f141e71c04b3c7923eb0f0539b2a0eb0cbd47000ccd6bc8ebe2fd1f58a6991cdcc92e600025e0ec4c74bed028b09e2bc8e23a0d26940015edb91c8
@@ -6,7 +6,7 @@ require 'vector_salad/canvas'
6
6
  module VectorSalad
7
7
  module StandardShapes
8
8
  class Custom < BasicShape
9
- def initialize(name, &block)
9
+ def initialize(name, **options, &block)
10
10
  #instance_eval(&block)
11
11
  ::VectorSalad::StandardShapes.const_set(name.to_s.capitalize.to_sym, Class.new(BasicShape) do
12
12
  include VectorSalad::DSL
@@ -32,7 +32,13 @@ module VectorSalad
32
32
  self
33
33
  end
34
34
 
35
- # Move the shape relatively.
35
+ # Move the MultiPath absolutely.
36
+ Contract Num, Num => MultiPath
37
+ def [](x, y)
38
+ each_send(:[], x, y)
39
+ end
40
+
41
+ # Move the MultiPath relatively.
36
42
  Contract Num, Num => MultiPath
37
43
  def move(x, y)
38
44
  each_send(:move, x, y)
@@ -61,7 +61,16 @@ module VectorSalad
61
61
  self
62
62
  end
63
63
 
64
- # Move the shape relatively.
64
+ # Move the path absolutely.
65
+ Contract Num, Num => Path
66
+ def [](x, y)
67
+ @nodes.map do |node|
68
+ node[x, y]
69
+ end
70
+ self
71
+ end
72
+
73
+ # Move the path relatively.
65
74
  Contract Num, Num => Path
66
75
  def move(x, y)
67
76
  Path.new(
@@ -1,3 +1,3 @@
1
1
  module VectorSalad
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vector_salad
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon George