class ContentfulLite::Asset
Private Class Methods
asset_attribute(key, path, default: nil)
click to toggle source
@api private @!macro [attach] asset_attribute
Returns the $1 attribute of the Contentful Asset
# File lib/contentful_lite/asset.rb, line 16 def self.asset_attribute(key, path, default: nil) define_method(key) do |locale: nil| path.inject(fields(locale: locale)) { |hash, path_section| hash.nil? ? nil : hash[path_section] } || default end end
Public Instance Methods
contentful_link()
click to toggle source
Gets the URL to view/edit the entry on Contentful webapp @return [String]
# File lib/contentful_lite/asset.rb, line 9 def contentful_link "https://app.contentful.com/spaces/#{space_id}/assets/#{id}" end