Class: Mediafire::StoreFolder

Inherits:
StoreObject show all
Defined in:
lib/mediafire/store_object.rb

Instance Method Summary collapse

Methods inherited from StoreObject

#date, #description, #initialize, #is_public?, #tags

Constructor Details

This class inherits a constructor from Mediafire::StoreObject

Instance Method Details

#custom_urlObject



103
104
105
# File 'lib/mediafire/store_object.rb', line 103

def custom_url
  @custom_url
end

#data(d) ⇒ Object



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/mediafire/store_object.rb', line 44

def data(d)
  super(d)

  folders = []
  files = []

  if d.key?('folders')
    d['folders'].each do |f|
      folders << StoreFolder.new(f)
    end
  end

  if d.key?('files')
    d['files'].each do |f|
      files << StoreFile.new(f)
    end
  end

  @folders         = folders
  @files           = files

  @name            = d['name']            || ''
  @key             = d['folderkey']       || ''
  @dropbox_enabled = d['dropbox_enabled'] || ''
  @custom_url      = d['custom_url']      || ''
  @revision        = d['revision'].to_i
  @file_count      = d['file_count'].to_i
end

#dropbox_enabled?Boolean

Returns:

  • (Boolean)


87
88
89
90
91
92
93
# File 'lib/mediafire/store_object.rb', line 87

def dropbox_enabled?
  if @dropbox_enabled == 'yes'
    true
  else
    false
  end
end

#file_countObject



99
100
101
# File 'lib/mediafire/store_object.rb', line 99

def file_count
  @file_count
end

#filesObject



111
112
113
# File 'lib/mediafire/store_object.rb', line 111

def files
  @files
end

#folder_keyObject Also known as: folderkey, key



77
78
79
# File 'lib/mediafire/store_object.rb', line 77

def folder_key
  @key
end

#foldersObject



107
108
109
# File 'lib/mediafire/store_object.rb', line 107

def folders
  @folders
end

#is_folder?Boolean

Returns:

  • (Boolean)


73
74
75
# File 'lib/mediafire/store_object.rb', line 73

def is_folder?
  true
end

#nameObject



83
84
85
# File 'lib/mediafire/store_object.rb', line 83

def name
  @name
end

#revisionObject



95
96
97
# File 'lib/mediafire/store_object.rb', line 95

def revision
  @revision
end