Class: Guard::Haskell::Repl::Sandbox

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/guard/haskell/repl.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#sandboxesObject (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

Yields:

  • (best)


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