Class: Attachment

Inherits:
Object
  • Object
show all
Defined in:
lib/models/attachment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ Attachment

Returns a new instance of Attachment.



4
5
6
# File 'lib/models/attachment.rb', line 4

def initialize(json)
  json.each { |key, value| instance_variable_set("@#{key}", value) }
end

Instance Attribute Details

#contentObject

Returns the value of attribute content.



2
3
4
# File 'lib/models/attachment.rb', line 2

def content
  @content
end

#filenameObject

Returns the value of attribute filename.



2
3
4
# File 'lib/models/attachment.rb', line 2

def filename
  @filename
end

#mimeTypeObject

Returns the value of attribute mimeType.



2
3
4
# File 'lib/models/attachment.rb', line 2

def mimeType
  @mimeType
end

Instance Method Details

#to_sObject



8
9
10
# File 'lib/models/attachment.rb', line 8

def to_s
  "Name: #{filename}, Mime-Type: #{mimeType}"
end