class Swamp::Evaluator

Public Class Methods

new(input, wrapper) click to toggle source
# File lib/swamp/evaluator.rb, line 3
def initialize(input, wrapper)
  @input = input
  @wrapper = wrapper
end

Public Instance Methods

enter_keystroke?() click to toggle source
# File lib/swamp/evaluator.rb, line 16
def enter_keystroke?
  @input == "\n"
end
refresh_command?() click to toggle source
# File lib/swamp/evaluator.rb, line 12
def refresh_command?
  enter_keystroke? and @wrapper.page_visited
end
valid_url?() click to toggle source
# File lib/swamp/evaluator.rb, line 8
def valid_url?
  @input.match(/^(http|https|file):\/\/.*$/i) ? true : false
end