Class: Congo::Grip::Attachment
- Inherits:
-
Object
- Object
- Congo::Grip::Attachment
- Defined in:
- lib/congo/grip/attachment.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#content_type ⇒ Object
readonly
Returns the value of attribute content_type.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Attachment
constructor
A new instance of Attachment.
- #to_s ⇒ Object
Constructor Details
#initialize(attrs = {}) ⇒ Attachment
Returns a new instance of Attachment.
7 8 9 10 11 12 13 |
# File 'lib/congo/grip/attachment.rb', line 7 def initialize(attrs = {}) @name = attrs[:name] @path = attrs[:path] @content_type = attrs[:content_type] @size = attrs[:size] @body = attrs[:body] end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
5 6 7 |
# File 'lib/congo/grip/attachment.rb', line 5 def body @body end |
#content_type ⇒ Object (readonly)
Returns the value of attribute content_type.
5 6 7 |
# File 'lib/congo/grip/attachment.rb', line 5 def content_type @content_type end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/congo/grip/attachment.rb', line 5 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
5 6 7 |
# File 'lib/congo/grip/attachment.rb', line 5 def path @path end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
5 6 7 |
# File 'lib/congo/grip/attachment.rb', line 5 def size @size end |
Instance Method Details
#to_s ⇒ Object
15 16 17 |
# File 'lib/congo/grip/attachment.rb', line 15 def to_s self.body end |