attentive 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/attentive/entity.rb +6 -2
- data/lib/attentive/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: 96872811cbdc5d9db062e11cca2471dc4079a26d
|
4
|
+
data.tar.gz: 0df0336e5edf492c51048473605c69a7e9fe1886
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61869eae6aacb6c2a66aca38e55ef1ca927236d8239ad402c761744e88a8a9dad99006b5fec14648fe740d43df83a2678c45fad1403ce0f3444fa444261971c2
|
7
|
+
data.tar.gz: 4305e44d30e464ff734a72aa3326b9525776ba35f45330cbef4018d8541f754300bd41e4395531831cc628b6ba58ed7f1f7f26511f29d2bdfcd5f87680e3dec5
|
data/lib/attentive/entity.rb
CHANGED
@@ -55,8 +55,12 @@ module Attentive
|
|
55
55
|
|
56
56
|
def matches?(cursor)
|
57
57
|
self.class.phrases.each do |phrase|
|
58
|
-
|
59
|
-
|
58
|
+
cursor_copy = cursor.dup
|
59
|
+
match = Attentive::Matcher.new(phrase, cursor_copy).match!
|
60
|
+
if match
|
61
|
+
cursor.instance_variable_set :@pos, cursor_copy.pos
|
62
|
+
return { variable_name => _value_from_match(match) }
|
63
|
+
end
|
60
64
|
end
|
61
65
|
false
|
62
66
|
end
|
data/lib/attentive/version.rb
CHANGED