Class: Congo::Grip::Attachment

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#bodyObject (readonly)

Returns the value of attribute body.



5
6
7
# File 'lib/congo/grip/attachment.rb', line 5

def body
  @body
end

#content_typeObject (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

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/congo/grip/attachment.rb', line 5

def name
  @name
end

#pathObject (readonly)

Returns the value of attribute path.



5
6
7
# File 'lib/congo/grip/attachment.rb', line 5

def path
  @path
end

#sizeObject (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_sObject



15
16
17
# File 'lib/congo/grip/attachment.rb', line 15

def to_s
  self.body
end