Class: Opener::S3Outlet

Inherits:
Object
  • Object
show all
Defined in:
lib/opener/s3_outlet.rb,
lib/opener/s3_outlet/server.rb,
lib/opener/s3_outlet/version.rb,
lib/opener/s3_outlet/s3_output.rb

Defined Under Namespace

Classes: S3Output, Server

Constant Summary collapse

VERSION =
"1.1.1"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ S3Outlet

Returns a new instance of S3Outlet.



11
12
13
# File 'lib/opener/s3_outlet.rb', line 11

def initialize(options={})
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



9
10
11
# File 'lib/opener/s3_outlet.rb', line 9

def options
  @options
end

Class Method Details

.bucketObject



26
27
28
# File 'lib/opener/s3_outlet.rb', line 26

def self.bucket
  @bucket ||= s3.buckets[bucket_name]
end

.bucket_nameObject



30
31
32
# File 'lib/opener/s3_outlet.rb', line 30

def self.bucket_name
  return "opener-outlet"
end

.dirObject



34
35
36
# File 'lib/opener/s3_outlet.rb', line 34

def self.dir
  return "webservice"
end

.s3Object



22
23
24
# File 'lib/opener/s3_outlet.rb', line 22

def self.s3
  @s3 ||= AWS::S3.new
end

Instance Method Details

#run(input) ⇒ Object



15
16
17
18
19
20
# File 'lib/opener/s3_outlet.rb', line 15

def run(input)
  options[:text] = input
  S3Output.create(options)

  return input #Return original input so that we can keep on chaining.
end