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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4097a322261edfff741d8aa066a56c83be69642e
|
4
|
+
data.tar.gz: f48ee96bc523a4330261964a61a6ac5ee406693b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
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(
|
data/lib/vector_salad/version.rb
CHANGED