Class: Dropbox::FileMetadata
- Defined in:
- lib/dropbox/metadata.rb
Overview
Contains the metadata (but not contents) of a file.
Instance Attribute Summary collapse
-
#client_modified ⇒ Object
readonly
Returns the value of attribute client_modified.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#rev ⇒ Object
readonly
Returns the value of attribute rev.
-
#server_modified ⇒ Object
readonly
Returns the value of attribute server_modified.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Attributes inherited from Metadata
#name, #path_display, #path_lower
Instance Method Summary collapse
- #==(cmp) ⇒ Object
-
#initialize(attrs = {}) ⇒ FileMetadata
constructor
A new instance of FileMetadata.
Constructor Details
#initialize(attrs = {}) ⇒ FileMetadata
Returns a new instance of FileMetadata.
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/dropbox/metadata.rb', line 19 def initialize(attrs={}) @id = attrs.delete('id') if cm = attrs.delete('client_modified') @client_modified = Time.parse(cm) end @server_modified = Time.parse(attrs.delete('server_modified')) @rev = attrs.delete('rev') @size = attrs.delete('size') super(attrs) end |
Instance Attribute Details
#client_modified ⇒ Object (readonly)
Returns the value of attribute client_modified.
17 18 19 |
# File 'lib/dropbox/metadata.rb', line 17 def client_modified @client_modified end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
17 18 19 |
# File 'lib/dropbox/metadata.rb', line 17 def id @id end |
#rev ⇒ Object (readonly)
Returns the value of attribute rev.
17 18 19 |
# File 'lib/dropbox/metadata.rb', line 17 def rev @rev end |
#server_modified ⇒ Object (readonly)
Returns the value of attribute server_modified.
17 18 19 |
# File 'lib/dropbox/metadata.rb', line 17 def server_modified @server_modified end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
17 18 19 |
# File 'lib/dropbox/metadata.rb', line 17 def size @size end |
Instance Method Details
#==(cmp) ⇒ Object
30 31 32 |
# File 'lib/dropbox/metadata.rb', line 30 def ==(cmp) cmp.is_a?(self.class) && self.id == cmp.id end |