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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0663ec76ffb5ce9f6a83f9d705fa0db42140d321
4
- data.tar.gz: 4276cb5695eec75a1ee57fe0ba24d26c16ecb688
3
+ metadata.gz: 5e93725cf8217f513e9f7c233f333bedc0845ae1
4
+ data.tar.gz: 6472432af7538e0fd2630acf56d250a8fd98a419
5
5
  SHA512:
6
- metadata.gz: 8e5b8999a2d59992f03f1d38ddf3b79c6dfb6e07df1bb4c574b3648e3f3ef92ef83b23ccfeab47a1bf2a7128fb1ac45b9cb55628288b93869dde9876a7468c7b
7
- data.tar.gz: 95f942f7ff068d9dea4c0447279a5716869b6432655db10733fe5873b117c6e7e37854d0d9b528cc6561e380a3599b0b5adac7e373b18809e34e55d3ce5ef47c
6
+ metadata.gz: d6b5baf7cc4e5fc2ef8590ad748aea81c41da1a577f342073da5de6631bc19187d57323cc00ba8762d66da77f6e1c0b7614957f720fb70c504e418063983b494
7
+ data.tar.gz: 3faad832dc6e2f70ba227708922d9e8217cdbeb7b5fe37dfd081f6452c6c0ea5b43801056416e1e69904a355538d539957d6ac96ad940d30963d735acdfa48f4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ellington (0.2.1)
4
+ ellington (0.2.3)
5
5
  hero (~> 0.2.0)
6
6
  ruby-graphviz (~> 1.2.1)
7
7
  state_jacket (~> 0.1.1)
@@ -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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Ellington
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
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.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-19 00:00:00.000000000 Z
11
+ date: 2014-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hero