ellington 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/ellington/conductor.rb +4 -0
- data/lib/ellington/route.rb +7 -0
- data/lib/ellington/version.rb +1 -1
- 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: 5e93725cf8217f513e9f7c233f333bedc0845ae1
|
4
|
+
data.tar.gz: 6472432af7538e0fd2630acf56d250a8fd98a419
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6b5baf7cc4e5fc2ef8590ad748aea81c41da1a577f342073da5de6631bc19187d57323cc00ba8762d66da77f6e1c0b7614957f720fb70c504e418063983b494
|
7
|
+
data.tar.gz: 3faad832dc6e2f70ba227708922d9e8217cdbeb7b5fe37dfd081f6452c6c0ea5b43801056416e1e69904a355538d539957d6ac96ad940d30963d735acdfa48f4
|
data/Gemfile.lock
CHANGED
data/lib/ellington/conductor.rb
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
require_relative "route"
|
2
|
+
require_relative "passenger"
|
3
|
+
|
1
4
|
module Ellington
|
2
5
|
class Conductor
|
3
6
|
attr_reader :route
|
@@ -13,6 +16,7 @@ module Ellington
|
|
13
16
|
end
|
14
17
|
|
15
18
|
def conduct(passenger)
|
19
|
+
passenger = route.create_passenger(passenger) unless passenger.is_a?(Passenger)
|
16
20
|
return unless verify(passenger)
|
17
21
|
route.lines.first.board passenger
|
18
22
|
end
|
data/lib/ellington/route.rb
CHANGED
@@ -2,6 +2,7 @@ require "delegate"
|
|
2
2
|
require "fileutils"
|
3
3
|
require "observer"
|
4
4
|
require_relative "has_targets"
|
5
|
+
require_relative "passenger"
|
5
6
|
|
6
7
|
module Ellington
|
7
8
|
class Route < SimpleDelegator
|
@@ -34,6 +35,12 @@ module Ellington
|
|
34
35
|
end
|
35
36
|
end
|
36
37
|
|
38
|
+
def create_passenger(context, ticket: Ellington::Ticket.new, state_history: [])
|
39
|
+
passenger = Passenger.new(context, route: self, ticket: ticket, state_history: state_history)
|
40
|
+
passenger.current_state = initial_state
|
41
|
+
passenger
|
42
|
+
end
|
43
|
+
|
37
44
|
class << self
|
38
45
|
include Observable
|
39
46
|
include HasTargets
|
data/lib/ellington/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ellington
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Hopkins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hero
|