Class: Attachment
- Inherits:
-
Object
- Object
- Attachment
- Defined in:
- lib/models/attachment.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#mimeType ⇒ Object
Returns the value of attribute mimeType.
Instance Method Summary collapse
-
#initialize(json) ⇒ Attachment
constructor
A new instance of Attachment.
- #to_s ⇒ Object
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
#content ⇒ Object
Returns the value of attribute content.
2 3 4 |
# File 'lib/models/attachment.rb', line 2 def content @content end |
#filename ⇒ Object
Returns the value of attribute filename.
2 3 4 |
# File 'lib/models/attachment.rb', line 2 def filename @filename end |
#mimeType ⇒ Object
Returns the value of attribute mimeType.
2 3 4 |
# File 'lib/models/attachment.rb', line 2 def mimeType @mimeType end |
Instance Method Details
#to_s ⇒ Object
8 9 10 |
# File 'lib/models/attachment.rb', line 8 def to_s "Name: #{filename}, Mime-Type: #{mimeType}" end |