Class: Nelumba::File
Constant Summary
Constants included from Object
Object::USERNAME_REGULAR_EXPRESSION
Instance Attribute Summary collapse
-
#file_url ⇒ Object
readonly
Returns the value of attribute file_url.
-
#length ⇒ Object
readonly
Returns the value of attribute length.
-
#md5 ⇒ Object
readonly
Returns the value of attribute md5.
-
#mime_type ⇒ Object
readonly
Returns the value of attribute mime_type.
Attributes included from Object
#author, #content, #display_name, #html, #image, #published, #summary, #text, #title, #uid, #updated, #url
Instance Method Summary collapse
- #init(options = {}, &blk) ⇒ Object
-
#initialize(options = {}, &blk) ⇒ File
constructor
A new instance of File.
- #to_hash ⇒ Object
- #to_json_hash ⇒ Object
Methods included from Object
#mentions, #reply_to, #to_as1, #to_html, #to_json, #to_text
Constructor Details
#initialize(options = {}, &blk) ⇒ File
Returns a new instance of File.
11 12 13 |
# File 'lib/nelumba/file.rb', line 11 def initialize( = {}, &blk) init(, &blk) end |
Instance Attribute Details
#file_url ⇒ Object (readonly)
Returns the value of attribute file_url.
5 6 7 |
# File 'lib/nelumba/file.rb', line 5 def file_url @file_url end |
#length ⇒ Object (readonly)
Returns the value of attribute length.
8 9 10 |
# File 'lib/nelumba/file.rb', line 8 def length @length end |
#md5 ⇒ Object (readonly)
Returns the value of attribute md5.
9 10 11 |
# File 'lib/nelumba/file.rb', line 9 def md5 @md5 end |
#mime_type ⇒ Object (readonly)
Returns the value of attribute mime_type.
6 7 8 |
# File 'lib/nelumba/file.rb', line 6 def mime_type @mime_type end |
Instance Method Details
#init(options = {}, &blk) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/nelumba/file.rb', line 15 def init( = {}, &blk) super @md5 = [:md5] @file_url = [:file_url] @mime_type = [:mime_type] @length = [:length] end |
#to_hash ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/nelumba/file.rb', line 24 def to_hash { :md5 => @md5, :file_url => @file_url, :mime_type => @mime_type, :length => @length }.merge(super) end |
#to_json_hash ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/nelumba/file.rb', line 33 def to_json_hash { :objectType => "file", :md5 => @md5, :fileUrl => @file_url, :mimeType => @mime_type, :length => @length }.merge(super) end |