Class: Rmb::Asset

Inherits:
Resource show all
Defined in:
lib/rmb/asset.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

client, #initialize

Constructor Details

This class inherits a constructor from Rmb::Resource

Instance Attribute Details

#artistObject

Returns the value of attribute artist.



3
4
5
# File 'lib/rmb/asset.rb', line 3

def artist
  @artist
end

#contentsObject

Returns the value of attribute contents.



3
4
5
# File 'lib/rmb/asset.rb', line 3

def contents
  @contents
end

#created_atObject

Returns the value of attribute created_at.



3
4
5
# File 'lib/rmb/asset.rb', line 3

def created_at
  @created_at
end

#descriptionObject

Returns the value of attribute description.



3
4
5
# File 'lib/rmb/asset.rb', line 3

def description
  @description
end

#dropObject

Returns the value of attribute drop.



3
4
5
# File 'lib/rmb/asset.rb', line 3

def drop
  @drop
end

#durationObject

Returns the value of attribute duration.



3
4
5
# File 'lib/rmb/asset.rb', line 3

def duration
  @duration
end

#filesizeObject

Returns the value of attribute filesize.



3
4
5
# File 'lib/rmb/asset.rb', line 3

def filesize
  @filesize
end

#heightObject

Returns the value of attribute height.



3
4
5
# File 'lib/rmb/asset.rb', line 3

def height
  @height
end

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/rmb/asset.rb', line 3

def id
  @id
end

#locationsObject

Returns the value of attribute locations.



3
4
5
# File 'lib/rmb/asset.rb', line 3

def locations
  @locations
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/rmb/asset.rb', line 3

def name
  @name
end

#pagesObject

Returns the value of attribute pages.



3
4
5
# File 'lib/rmb/asset.rb', line 3

def pages
  @pages
end

#rolesObject

Returns the value of attribute roles.



3
4
5
# File 'lib/rmb/asset.rb', line 3

def roles
  @roles
end

#statusObject

Returns the value of attribute status.



3
4
5
# File 'lib/rmb/asset.rb', line 3

def status
  @status
end

#titleObject

Returns the value of attribute title.



3
4
5
# File 'lib/rmb/asset.rb', line 3

def title
  @title
end

#track_titleObject

Returns the value of attribute track_title.



3
4
5
# File 'lib/rmb/asset.rb', line 3

def track_title
  @track_title
end

#typeObject

Returns the value of attribute type.



3
4
5
# File 'lib/rmb/asset.rb', line 3

def type
  @type
end

#urlObject

Returns the value of attribute url.



3
4
5
# File 'lib/rmb/asset.rb', line 3

def url
  @url
end

#widthObject

Returns the value of attribute width.



3
4
5
# File 'lib/rmb/asset.rb', line 3

def width
  @width
end

Class Method Details

.find(drop, id) ⇒ Object

Finds a particular Asset by drop and asset name.



8
9
10
# File 'lib/rmb/asset.rb', line 8

def self.find(drop, id)
  Rmb::Resource.client.asset(drop, id)
end

Instance Method Details

#change_name(new_name) ⇒ Object

Changes the name of an asset.



13
14
15
# File 'lib/rmb/asset.rb', line 13

def change_name(new_name)
  Rmb::Resource.client.change_asset_name(self,new_name)
end

#copy_to(target_drop) ⇒ Object

Copies the Asset to the given drop.



41
42
43
# File 'lib/rmb/asset.rb', line 41

def copy_to(target_drop)
  Rmb::Resource.client.copy_asset(self, target_drop)
end

#destroy!Object

Destroys the Asset on the RMB Don’t try to use an Asset after destroying it.



23
24
25
26
# File 'lib/rmb/asset.rb', line 23

def destroy!
  Rmb::Resource.client.delete_asset(self)
  return nil
end

#destroy_location!(role, location) ⇒ Object

Destroys the given role at the specified location on an Asset



35
36
37
38
# File 'lib/rmb/asset.rb', line 35

def destroy_location!(role, location)
  Rmb::Resource.client.delete_role(self, role, location)
  return nil
end

#destroy_role!(role) ⇒ Object

Destroys the given role on an Asset



29
30
31
32
# File 'lib/rmb/asset.rb', line 29

def destroy_role!(role)
  Rmb::Resource.client.delete_role(self, role)
  return nil
end

#generate_urlObject

Generates an authenticated URL that will bypass any login action.



56
57
58
# File 'lib/rmb/asset.rb', line 56

def generate_url
  Rmb::Resource.client.generate_asset_url(self)
end

#move_to(target_drop) ⇒ Object

Moves the Asset to the given drop.



46
47
48
# File 'lib/rmb/asset.rb', line 46

def move_to(target_drop)
  Rmb::Resource.client.move_asset(self, target_drop)
end

#original_file_url(time_to_live = 600) ⇒ Object

Generates a url if there’s access to the original file.



61
62
63
# File 'lib/rmb/asset.rb', line 61

def original_file_url(time_to_live = 600)
  Rmb::Resource.client.generate_original_file_url(self)
end

#saveObject

Saves the Asset back to the RMB



18
19
20
# File 'lib/rmb/asset.rb', line 18

def save
  Rmb::Resource.client.update_asset(self)
end

#send_to_drop(drop) ⇒ Object

Sends the Asset to a Drop by drop_name



51
52
53
# File 'lib/rmb/asset.rb', line 51

def send_to_drop(drop)
  Rmb::Resource.client.copy_asset(self, drop)
end