Class: Layabout::FileUpload

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/layabout/file_upload.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ FileUpload

Returns a new instance of FileUpload.



12
13
14
15
16
17
18
19
20
# File 'lib/layabout/file_upload.rb', line 12

def initialize(options={})
  @configuration   = ::Layabout.configuration
  @filepath        = options.fetch(:filepath)
  @channels        = options.fetch(:channels)
  @filetype        = options[:filetype]
  @filename        = options[:filename]
  @title           = options[:title]
  @initial_comment = options[:initial_comment]
end

Instance Attribute Details

#channelsObject (readonly)

Returns the value of attribute channels.



10
11
12
# File 'lib/layabout/file_upload.rb', line 10

def channels
  @channels
end

#filepathObject (readonly)

Returns the value of attribute filepath.



10
11
12
# File 'lib/layabout/file_upload.rb', line 10

def filepath
  @filepath
end

Instance Method Details

#uploadObject



22
23
24
# File 'lib/layabout/file_upload.rb', line 22

def upload
  SlackResponse.new(wrap(http_response))
end