Class: Aygabtu::Handle
- Inherits:
-
Object
- Object
- Aygabtu::Handle
- Defined in:
- lib/aygabtu/handle.rb
Instance Method Summary collapse
- #checkpoint ⇒ Object
- #generate_checkpoint ⇒ Object
-
#initialize ⇒ Handle
constructor
A new instance of Handle.
- #routes ⇒ Object
- #verbose! ⇒ Object
- #verbose? ⇒ Boolean
Constructor Details
#initialize ⇒ Handle
Returns a new instance of Handle.
6 7 8 |
# File 'lib/aygabtu/handle.rb', line 6 def initialize @verbose = false end |
Instance Method Details
#checkpoint ⇒ Object
16 17 18 |
# File 'lib/aygabtu/handle.rb', line 16 def checkpoint @checkpoint || 0 end |
#generate_checkpoint ⇒ Object
20 21 22 23 24 |
# File 'lib/aygabtu/handle.rb', line 20 def generate_checkpoint @checkpoint = (checkpoint + 1).tap do |new_checkpoint| puts "New checkpoint #{new_checkpoint}" if verbose? end end |
#routes ⇒ Object
10 11 12 13 14 |
# File 'lib/aygabtu/handle.rb', line 10 def routes @routes ||= rails_application_routes.set.map do |journey_route| RouteWrapper.new(journey_route) end.select(&:get?).reject(&:internal?) end |
#verbose! ⇒ Object
26 27 28 |
# File 'lib/aygabtu/handle.rb', line 26 def verbose! @verbose = true end |
#verbose? ⇒ Boolean
30 31 32 |
# File 'lib/aygabtu/handle.rb', line 30 def verbose? @verbose end |