Class: RabbitHole::Base
- Inherits:
-
Object
- Object
- RabbitHole::Base
- Defined in:
- lib/rabbit_hole/base.rb
Instance Method Summary collapse
-
#initialize(yml_path = "#{Dir.home}/.rabbit_hole.yml") ⇒ Base
constructor
A new instance of Base.
- #pop ⇒ Object
- #push(task) ⇒ Object
- #size ⇒ Object
- #tasks ⇒ Object
- #top ⇒ Object
Constructor Details
#initialize(yml_path = "#{Dir.home}/.rabbit_hole.yml") ⇒ Base
Returns a new instance of Base.
7 8 9 |
# File 'lib/rabbit_hole/base.rb', line 7 def initialize(yml_path = "#{Dir.home}/.rabbit_hole.yml") @yml_path = yml_path end |
Instance Method Details
#pop ⇒ Object
17 18 19 20 21 |
# File 'lib/rabbit_hole/base.rb', line 17 def pop with_stack do |stack| stack.pop end end |
#push(task) ⇒ Object
11 12 13 14 15 |
# File 'lib/rabbit_hole/base.rb', line 11 def push(task) with_stack do |stack| stack.push(task) end end |
#size ⇒ Object
29 30 31 32 33 |
# File 'lib/rabbit_hole/base.rb', line 29 def size with_stack do |stack| stack.size end end |
#tasks ⇒ Object
35 36 37 38 39 |
# File 'lib/rabbit_hole/base.rb', line 35 def tasks with_stack do |stack| stack end end |
#top ⇒ Object
23 24 25 26 27 |
# File 'lib/rabbit_hole/base.rb', line 23 def top with_stack do |stack| stack.last end end |