Created
April 7, 2011 22:10
-
-
Save developwithpassion/908873 to your computer and use it in GitHub Desktop.
viking utilities
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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