Class: Guard::Haskell::Repl::Sandbox
- Inherits:
-
Object
- Object
- Guard::Haskell::Repl::Sandbox
- Includes:
- Enumerable
- Defined in:
- lib/guard/haskell/repl.rb
Instance Attribute Summary collapse
-
#sandboxes ⇒ Object
readonly
Returns the value of attribute sandboxes.
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(glob) ⇒ Sandbox
constructor
A new instance of Sandbox.
- #with_best_sandbox(ordering) {|best| ... } ⇒ Object
Constructor Details
#initialize(glob) ⇒ Sandbox
Returns a new instance of Sandbox.
79 80 81 |
# File 'lib/guard/haskell/repl.rb', line 79 def initialize(glob) @sandboxes = ::Dir[glob] end |
Instance Attribute Details
#sandboxes ⇒ Object (readonly)
Returns the value of attribute sandboxes.
75 76 77 |
# File 'lib/guard/haskell/repl.rb', line 75 def sandboxes @sandboxes end |
Instance Method Details
#each(&block) ⇒ Object
83 84 85 |
# File 'lib/guard/haskell/repl.rb', line 83 def each(&block) sandboxes.each(&block) end |
#with_best_sandbox(ordering) {|best| ... } ⇒ Object
87 88 89 90 91 |
# File 'lib/guard/haskell/repl.rb', line 87 def with_best_sandbox(ordering) best = sandboxes.max_by(&ordering) yield best if best best end |