Class: InteractiveS3::Interpreter

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/interactive_s3/interpreter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeInterpreter

Returns a new instance of Interpreter.



11
12
13
14
# File 'lib/interactive_s3/interpreter.rb', line 11

def initialize
  @s3 = S3.new
  @state = {}
end

Instance Attribute Details

#s3Object (readonly)

Returns the value of attribute s3.



7
8
9
# File 'lib/interactive_s3/interpreter.rb', line 7

def s3
  @s3
end

#stateObject (readonly)

Returns the value of attribute state.



7
8
9
# File 'lib/interactive_s3/interpreter.rb', line 7

def state
  @state
end

Instance Method Details

#execute(input) ⇒ Object



16
17
18
19
20
# File 'lib/interactive_s3/interpreter.rb', line 16

def execute(input)
  build_command(input).execute
rescue CommandError => e
  puts e.class, e.message, e.backtrace.join("\n")
end