another_toy_robot 0.1.12 → 0.1.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/another_toy_robot/client.rb +5 -1
- data/lib/another_toy_robot/input.rb +3 -9
- data/lib/another_toy_robot/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5a18c13b931414726f5791b99bfcf99aebeef33
|
4
|
+
data.tar.gz: c90671becf561d669c715735dc429e2a29832047
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d2f61536ae43ff3aaaec02c0cff2fab12bde726aa58dbdc5b5b0c95fa164c0dcd8b0bb8bbea87d90ddb20dda37548047d19bcfcf7430add2dfc261a4a1867fc
|
7
|
+
data.tar.gz: 139dfa912da0076ca7e0b47e8ef1aeebe45fb917ff8824e64afd6877f5723b4c73ad7015872c47f2acd4cbb8a2bd0e6942f89cbdf7ca30e5f5cee9c32b10a42f
|
@@ -10,21 +10,15 @@ class Input
|
|
10
10
|
@input = input.strip.downcase
|
11
11
|
end
|
12
12
|
|
13
|
-
def
|
14
|
-
|
13
|
+
def basename
|
14
|
+
@basename ||= @input.split(" ").first
|
15
15
|
end
|
16
16
|
|
17
|
-
private
|
18
|
-
|
19
17
|
def params
|
20
18
|
@params ||= @input.split(" ").drop 1
|
21
19
|
end
|
22
20
|
|
23
|
-
def
|
24
|
-
@basename ||= @input.split(" ").first
|
25
|
-
end
|
26
|
-
|
27
|
-
def command_class
|
21
|
+
def to_class
|
28
22
|
klass = "#{basename.capitalize}Command"
|
29
23
|
return InvalidCommand unless Object.const_defined? klass
|
30
24
|
Object.const_get klass
|