Class: Zae::Translate

Inherits:
Object
  • Object
show all
Defined in:
lib/zae/translate.rb

Overview

translate action to final command

Instance Method Summary collapse

Constructor Details

#initialize(action, arguments = []) ⇒ Translate

Returns a new instance of Translate.



19
20
21
22
23
24
# File 'lib/zae/translate.rb', line 19

def initialize(action, arguments = [])
  @action = action
  @arguments = arguments
  @configuration = Parse.new.found
  @permission = Permission.new(action, @configuration)
end

Instance Method Details

#to_sObject

simple string representation



27
28
29
30
# File 'lib/zae/translate.rb', line 27

def to_s
  command = @permission.super? ? @configuration[:super][@action] : @configuration[:user][@action]
  compose command
end