Class: Mediafire::StoreFile

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

#data(d) ⇒ Object



117
118
119
120
121
122
123
124
125
126
127
# File 'lib/mediafire/store_object.rb', line 117

def data(d)
  super(d)

  @filetype           = d['filetype']           || ''
  @key                = d['quickkey']           || ''
  @name               = d['filename']           || ''
  @password_protected = d['password_protected'] || ''
  @hash               = d['hash']               || ''
  @size               = d['size'].to_i
  @downloads          = d['downloads'].to_i
end

#downloadsObject



159
160
161
# File 'lib/mediafire/store_object.rb', line 159

def downloads
  @downloads
end

#filetypeObject



129
130
131
# File 'lib/mediafire/store_object.rb', line 129

def filetype
  @filetype
end

#hashObject Also known as: imagekey



171
172
173
# File 'lib/mediafire/store_object.rb', line 171

def hash
  @hash
end

#is_folder?Boolean

Returns:

  • (Boolean)


133
134
135
# File 'lib/mediafire/store_object.rb', line 133

def is_folder?
  false
end

#is_picture?Boolean

Returns:

  • (Boolean)


137
138
139
140
141
142
143
# File 'lib/mediafire/store_object.rb', line 137

def is_picture?
  if @filetype == 'image'
    true
  else
    false
  end
end

#nameObject



151
152
153
# File 'lib/mediafire/store_object.rb', line 151

def name
  @name
end

#protected?Boolean

Returns:

  • (Boolean)


163
164
165
166
167
168
169
# File 'lib/mediafire/store_object.rb', line 163

def protected?
  if @password_protected == 'yes'
    true
  else
    false
  end
end

#quick_keyObject Also known as: quickkey, key



145
146
147
# File 'lib/mediafire/store_object.rb', line 145

def quick_key
  @key
end

#sizeObject



155
156
157
# File 'lib/mediafire/store_object.rb', line 155

def size
  @size
end