Class: Megar::File

Inherits:
Object
  • Object
show all
Includes:
CatalogItem
Defined in:
lib/megar/catalog/file.rb

Overview

File collection item

Instance Attribute Summary collapse

Attributes included from CatalogItem

#id, #key, #name, #payload, #type

Instance Method Summary collapse

Methods included from CatalogItem

#==, #[], #attributes=, #collection, #each, #find_by_type, #initialize, #reset!, #resource_class

Instance Attribute Details

#sizeObject

The file size



6
7
8
# File 'lib/megar/catalog/file.rb', line 6

def size
  @size
end

Instance Method Details

#to_sObject

Return a pretty version of the file record



10
11
12
# File 'lib/megar/catalog/file.rb', line 10

def to_s
  format("%16d bytes  %-10s  %-60s", size.to_i, id, name)
end