Class: Hippo::Asset

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

Constant Summary

Constants included from Concerns::ApiAttributeAccess

Concerns::ApiAttributeAccess::DEFAULT_BLACKLISTED

Instance Method Summary collapse

Methods inherited from Model

belongs_to_tenant, scoped_by_tenant?

Methods included from Concerns::ApiAttributeAccess

#_set_attribute_data_from_collection, #set_attribute_data, #setting_attribute_is_allowed?

Instance Method Details

#path(size) ⇒ Object


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

def path(size)
    Hippo.config.api_path + Hippo.config.assets_path_prefix + '/' + file_data[size]['id']
end

#present?Boolean

Returns:

  • (Boolean)

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

def present?
    super && file.present?
end

#url(size = 'original') ⇒ Object


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

def url(size = 'original')
   "https://#{Hippo::Tenant.current.slug}.#{Hippo.config.website_domain}#{path(size)}"
end