Module: Assets

Included in:
Content
Defined in:
lib/user/content/assets.rb

Instance Method Summary collapse

Instance Method Details

#create_asset_size(data) ⇒ Object

FIXME: Trying to get property ‘path’ of non-object


45
46
47
# File 'lib/user/content/assets.rb', line 45

def create_asset_size(data) #FIXME: Trying to get property 'path' of non-object
    return @client.raw("post", "/content/assets/createSize", nil, data)
end

#delete_asset_sizeObject

TODO: Not tested


79
80
81
# File 'lib/user/content/assets.rb', line 79

def delete_asset_size #TODO: Not tested
    return @client.raw("get", "/content/assets/deleteSize")
end

#delete_asset_variationObject

TODO: Not tested


75
76
77
# File 'lib/user/content/assets.rb', line 75

def delete_asset_variation #TODO: Not tested
    return @client.raw("get", "/content/assets/deleteVariation")
end

#download_asset(id) ⇒ Object

Download asset.

Get information of an asset.

Parameters

  • id - [Integer] Asset id.

Example

@data = @mints_user.download_asset(2)

33
34
35
# File 'lib/user/content/assets.rb', line 33

def download_asset(id) #FIXME: File not found at path, error in result but method works
    return @client.raw("get", "/content/assets/download/#{id}")
end

#edit_asset_size(data) ⇒ Object

TODO: Not tested


37
38
39
# File 'lib/user/content/assets.rb', line 37

def edit_asset_size(data) #TODO: Not tested
    return @client.raw("post", "/content/assets/editSize", nil, data)
end

#generate_asset_variation(data) ⇒ Object

FIXME: Trying to get property ‘width’ of non-object


87
88
89
# File 'lib/user/content/assets.rb', line 87

def generate_asset_variation(data) #FIXME: Trying to get property 'width' of non-object
    return @client.raw("post", "/content/assets/generateAssetVariations", nil, data)
end

#get_asset_doc_typesObject


91
92
93
# File 'lib/user/content/assets.rb', line 91

def get_asset_doc_types
    return @client.raw("get", "/content/assets/docTypes")
end

#get_asset_info(options) ⇒ Object


83
84
85
# File 'lib/user/content/assets.rb', line 83

def get_asset_info(options)
    return @client.raw("get", "/content/assets/getAssetInfo", options)
end

Get asset link info.

Get information of an asset by url.

Parameters

data

(Hash) – Data to be submited.

Example

data = { 
  "link": "https://www.example.com/img/img.jpg"
}
@data = @mints_user.get_asset_link_info(data.to_json)

21
22
23
# File 'lib/user/content/assets.rb', line 21

def get_asset_link_info(data)
    return @client.raw("post", "/content/assets/getLinkInfo", nil, data)
end

#get_asset_public_routeObject


95
96
97
# File 'lib/user/content/assets.rb', line 95

def get_asset_public_route
    return @client.raw("get", "/content/assets/publicRoute")
end

#get_asset_sizes(options) ⇒ Object

FIXME: wrong number of arguments (given 1, expected 0)


53
54
55
# File 'lib/user/content/assets.rb', line 53

def get_asset_sizes(id) #FIXME: wrong number of arguments (given 1, expected 0)
    return @client.raw("get", "/content/assets/sizes/#{id}")
end

#get_asset_usage(options) ⇒ Object


71
72
73
# File 'lib/user/content/assets.rb', line 71

def get_asset_usage(options)
    return @client.raw("get", "/content/assets/usage", options)
end

#get_asset_variation(id) ⇒ Object


61
62
63
64
65
# File 'lib/user/content/assets.rb', line 61

def get_asset_variation(id)
    #FIXME: Id 1 and 4: Trying to get property 'path' of non-object
    #FIXME: Id 2 and 3: File not found at path maybe doesnt exist
    return @client.raw("get", "/content/assets/variation/#{id}")
end

#get_original_asset(id) ⇒ Object

FIXME: Doesn’t return JSON


57
58
59
# File 'lib/user/content/assets.rb', line 57

def get_original_asset(id) #FIXME: Doesn't return JSON
    return @client.raw("get", "/content/assets/original/#{id}")
end

#update_asset_variation(id, data) ⇒ Object

TODO:


49
50
51
# File 'lib/user/content/assets.rb', line 49

def update_asset_variation(id, data) #TODO:
    return @client.raw("post", "/content/assets/updateVariation/#{id}", nil, data)
end

#upload_asset(data) ⇒ Object

Assets


6
7
8
# File 'lib/user/content/assets.rb', line 6

def upload_asset(data)
    return @client.raw("post", "/content/assets/upload", nil, data)
end

#upload_asset_variation(data) ⇒ Object

FIXME: Call to a member function guessClientExtension() on null


41
42
43
# File 'lib/user/content/assets.rb', line 41

def upload_asset_variation(data) #FIXME: Call to a member function guessClientExtension() on null
    return @client.raw("post", "/content/assets/uploadVariation", nil, data)
end