Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save developwithpassion/908873 to your computer and use it in GitHub Desktop.
Save developwithpassion/908873 to your computer and use it in GitHub Desktop.
viking utilities
class Command
def initialize(action,description)
@action = action
@description = description
end
def call
@action.call
end
def to_s
"#{@description}"
end
end
def send_keys(keys,description = "Keys #{keys}")
command(lambda{send(keys)},description)
end
def lock_the_screen
command(lambda{lock_screen},"Lock the screen")
end
def display_message(message)
command(lambda{alert(message)},"Display the message #{message}")
end
def reload_configuration
command(lambda{ alert("Configuration reloaded successfully") if reload},"Reload Configuration")
end
def command(action,description)
Command.new(action,description)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment