Class: Mediafire::StoreObject

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

Direct Known Subclasses

StoreFile, StoreFolder

Instance Method Summary collapse

Constructor Details

#initialize(d) ⇒ StoreObject

Returns a new instance of StoreObject.



3
4
5
# File 'lib/mediafire/store_object.rb', line 3

def initialize(d)
  data(d)
end

Instance Method Details

#data(d) ⇒ Object



7
8
9
10
11
12
# File 'lib/mediafire/store_object.rb', line 7

def data(d)
  @created     = d['created'] || ''
  @tags        = d['tags']    || ''
  @description = d['desc']    || ''
  @privacy     = d['privacy'] || ''
end

#dateObject



22
23
24
# File 'lib/mediafire/store_object.rb', line 22

def date
  @created
end

#descriptionObject



30
31
32
# File 'lib/mediafire/store_object.rb', line 30

def description
  @description
end

#is_folder?Boolean

Returns:

  • (Boolean)


14
15
16
17
18
19
20
# File 'lib/mediafire/store_object.rb', line 14

def is_folder?
  if @data.key?('folder_key')
    true
  else
    false
  end
end

#is_public?Boolean

Returns:

  • (Boolean)


34
35
36
37
38
39
40
# File 'lib/mediafire/store_object.rb', line 34

def is_public?
  if @privacy == 'public'
    true
  else
    false
  end
end

#tagsObject



26
27
28
# File 'lib/mediafire/store_object.rb', line 26

def tags
  @tags
end