Class: Nelumba::Binary
Constant Summary
Constants included from Object
Object::USERNAME_REGULAR_EXPRESSION
Instance Attribute Summary collapse
-
#compression ⇒ Object
readonly
Returns the value of attribute compression.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#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) ⇒ Binary
constructor
A new instance of Binary.
- #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) ⇒ Binary
Returns a new instance of Binary.
14 15 16 |
# File 'lib/nelumba/binary.rb', line 14 def initialize( = {}, &blk) init(, &blk) end |
Instance Attribute Details
#compression ⇒ Object (readonly)
Returns the value of attribute compression.
9 10 11 |
# File 'lib/nelumba/binary.rb', line 9 def compression @compression end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
5 6 7 |
# File 'lib/nelumba/binary.rb', line 5 def data @data end |
#file_url ⇒ Object (readonly)
Returns the value of attribute file_url.
11 12 13 |
# File 'lib/nelumba/binary.rb', line 11 def file_url @file_url end |
#length ⇒ Object (readonly)
Returns the value of attribute length.
6 7 8 |
# File 'lib/nelumba/binary.rb', line 6 def length @length end |
#md5 ⇒ Object (readonly)
Returns the value of attribute md5.
8 9 10 |
# File 'lib/nelumba/binary.rb', line 8 def md5 @md5 end |
#mime_type ⇒ Object (readonly)
Returns the value of attribute mime_type.
12 13 14 |
# File 'lib/nelumba/binary.rb', line 12 def mime_type @mime_type end |
Instance Method Details
#init(options = {}, &blk) ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/nelumba/binary.rb', line 18 def init( = {}, &blk) super(, &blk) @data = [:data] @compression = [:compression] @md5 = [:md5] @file_url = [:file_url] @mime_type = [:mime_type] @length = [:length] end |
#to_hash ⇒ Object
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/nelumba/binary.rb', line 29 def to_hash { :data => @data, :compression => @compression, :md5 => @md5, :file_url => @file_url, :mime_type => @mime_type, :length => @length }.merge(super) end |
#to_json_hash ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/nelumba/binary.rb', line 40 def to_json_hash { :objectType => "binary", :data => @data, :compression => @compression, :md5 => @md5, :fileUrl => @file_url, :mimeType => @mime_type, :length => @length }.merge(super) end |