class Asset

Attributes

description[RW]
title[RW]

Public Class Methods

new(parent = nil, file = nil, title = nil, description = nil) click to toggle source

as an alternative to calling Asset.new, you can call populr.images.build

Calls superclass method RestfulModel::new
# File lib/asset.rb, line 9
def initialize(parent = nil, file = nil, title = nil, description = nil)
  super(parent)

  @file = file
  self.title = title
  self.description = description
end

Public Instance Methods

as_json(options = {}) click to toggle source
Calls superclass method RestfulModel#as_json
# File lib/asset.rb, line 17
def as_json(options = {})
  hash = super(options)
  hash[:file] = @file if options[:api_representation] && @file
  hash
end