Class: StrawberryAPI::Asset

Inherits:
Object
  • Object
show all
Defined in:
lib/strawberry_api/asset.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ Asset

Returns a new instance of Asset



25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/strawberry_api/asset.rb', line 25

def initialize(params = {})
  params.each do |k, v|
    if k == 'proxy'
      v = Proxy.new(v)
    elsif k == 'metadata'
      v&.map! do |metadatum|
        Metadatum.new(metadatum)
      end
    end
    
    instance_variable_set("@#{k.gsub(/[!@#$%^&*?']/, '')}", v) unless v.nil?
  end
end

Instance Attribute Details

#archive_strategy_idObject

Returns the value of attribute archive_strategy_id



7
8
9
# File 'lib/strawberry_api/asset.rb', line 7

def archive_strategy_id
  @archive_strategy_id
end

#audioObject

Returns the value of attribute audio



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

def audio
  @audio
end

#avidObject

Returns the value of attribute avid



16
17
18
# File 'lib/strawberry_api/asset.rb', line 16

def avid
  @avid
end

#clip_namesObject

Returns the value of attribute clip_names



22
23
24
# File 'lib/strawberry_api/asset.rb', line 22

def clip_names
  @clip_names
end

#created_atObject

Returns the value of attribute created_at



10
11
12
# File 'lib/strawberry_api/asset.rb', line 10

def created_at
  @created_at
end

#descriptionsObject

Returns the value of attribute descriptions



20
21
22
# File 'lib/strawberry_api/asset.rb', line 20

def descriptions
  @descriptions
end

#durationObject

Returns the value of attribute duration



19
20
21
# File 'lib/strawberry_api/asset.rb', line 19

def duration
  @duration
end

#file_namesObject

Returns the value of attribute file_names



17
18
19
# File 'lib/strawberry_api/asset.rb', line 17

def file_names
  @file_names
end

#idObject

Returns the value of attribute id



5
6
7
# File 'lib/strawberry_api/asset.rb', line 5

def id
  @id
end

#imageObject

Returns the value of attribute image



14
15
16
# File 'lib/strawberry_api/asset.rb', line 14

def image
  @image
end

#metadataObject

Returns the value of attribute metadata



21
22
23
# File 'lib/strawberry_api/asset.rb', line 21

def 
  @metadata
end

#nameObject

Returns the value of attribute name



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

def name
  @name
end

#project_idObject

Returns the value of attribute project_id



6
7
8
# File 'lib/strawberry_api/asset.rb', line 6

def project_id
  @project_id
end

#project_nameObject

Returns the value of attribute project_name



9
10
11
# File 'lib/strawberry_api/asset.rb', line 9

def project_name
  @project_name
end

#proxyObject

Returns the value of attribute proxy



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

def proxy
  @proxy
end

#sizeObject

Returns the value of attribute size



12
13
14
# File 'lib/strawberry_api/asset.rb', line 12

def size
  @size
end

#typeObject

Returns the value of attribute type



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

def type
  @type
end

#updated_atObject

Returns the value of attribute updated_at



11
12
13
# File 'lib/strawberry_api/asset.rb', line 11

def updated_at
  @updated_at
end

#videoObject

Returns the value of attribute video



15
16
17
# File 'lib/strawberry_api/asset.rb', line 15

def video
  @video
end

Instance Method Details

#audio?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/strawberry_api/asset.rb', line 39

def audio?
  audio
end

#image?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/strawberry_api/asset.rb', line 43

def image?
  image
end

#video?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/strawberry_api/asset.rb', line 47

def video?
  video
end