locationclass 0.0.1 → 0.1.0
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 +4 -4
- data/lib/main.rb +22 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74f2082fe5157cbe871a66d5e72df0e576bdaad2
|
4
|
+
data.tar.gz: effff02ee9d12e69478abdba94c4d8d35845c5ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5478f999ae911c8ea59f44838371f87f06ba725e39167c02b35ff9361d5b6fdb8184ee3b9c6439838f96875fd30a80eda1461bb6ad8f5ef45f96f44517536d42
|
7
|
+
data.tar.gz: f65c5633c99bfd207f7e868175cbcb5611844cbc0661d63895516d9dedaabad1a46502654673929af7a26bca4c2bd30d1bf8b57377c3fea3fccd784588347455
|
data/lib/main.rb
CHANGED
@@ -19,4 +19,26 @@ class Location
|
|
19
19
|
@x -= x
|
20
20
|
@y -= y
|
21
21
|
end
|
22
|
+
#Moves the location to the specified values.
|
23
|
+
def moveTo(x, y)
|
24
|
+
@x = x
|
25
|
+
@y = y
|
26
|
+
end
|
27
|
+
|
28
|
+
#Returns true if @x > @y.
|
29
|
+
def highest_value_x?()
|
30
|
+
return @x > @y
|
31
|
+
end
|
32
|
+
#Returns true if @y > @x.
|
33
|
+
def highest_value_y?()
|
34
|
+
return @y > @x
|
35
|
+
end
|
36
|
+
#Returns true unless @x > @y.
|
37
|
+
def lowest_value_x?()
|
38
|
+
return !highest_value_x?()
|
39
|
+
end
|
40
|
+
#Returns true unless @y > @x.
|
41
|
+
def lowest_value_y?()
|
42
|
+
return !highest_value_y?()
|
43
|
+
end
|
22
44
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: locationclass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SugarRush
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Represents a point on a 2D grid.
|
14
14
|
email:
|