Class: PogoPlug::FileListing
- Inherits:
-
Object
- Object
- PogoPlug::FileListing
- Includes:
- HashInitializer
- Defined in:
- lib/pogoplug/file_listing.rb
Instance Attribute Summary collapse
-
#files ⇒ Object
Returns the value of attribute files.
-
#offset ⇒ Object
Returns the value of attribute offset.
-
#size ⇒ Object
Returns the value of attribute size.
-
#total_count ⇒ Object
Returns the value of attribute total_count.
Class Method Summary collapse
Instance Method Summary collapse
Methods included from HashInitializer
Instance Attribute Details
#files ⇒ Object
Returns the value of attribute files.
5 6 7 |
# File 'lib/pogoplug/file_listing.rb', line 5 def files @files end |
#offset ⇒ Object
Returns the value of attribute offset.
5 6 7 |
# File 'lib/pogoplug/file_listing.rb', line 5 def offset @offset end |
#size ⇒ Object
Returns the value of attribute size.
5 6 7 |
# File 'lib/pogoplug/file_listing.rb', line 5 def size @size end |
#total_count ⇒ Object
Returns the value of attribute total_count.
5 6 7 |
# File 'lib/pogoplug/file_listing.rb', line 5 def total_count @total_count end |
Class Method Details
.from_json(json) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/pogoplug/file_listing.rb', line 15 def self.from_json(json) listing = FileListing.new( size: json['count'].to_i, offset: json['pageoffset'].to_i, total_count: json['totalcount'].to_i ) json['files'].each do |f| listing.files << File.from_json(f) end listing end |
Instance Method Details
#empty? ⇒ Boolean
11 12 13 |
# File 'lib/pogoplug/file_listing.rb', line 11 def empty? @files.empty? end |