Class: MongoMedia

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request = nil, params = nil) ⇒ MongoMedia

Returns a new instance of MongoMedia.



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/models/mongo_media.rb', line 6

def initialize request=nil, params=nil
  if (request != nil)      
    if (request_is_multipart_form(params))
      populate_from_multipart params
    elsif(request_is_octet_stream(params))
      populate_from_octet_stream(params, request)
    else
      populate_from_plain request
   end      
   @last_updated = Time.now.httpdate
  end
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



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

def body
  @body
end

#content_typeObject

Returns the value of attribute content_type.



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

def content_type
  @content_type
end

#last_updatedObject

Returns the value of attribute last_updated.



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

def last_updated
  @last_updated
end