class WcoHosting::ApplianceTmpl

def self.latest_of kind

def self.latest_of kind
  where({ kind: kind }).order_by({ version: :desc }).first
end

def name

def name
  "#{kind} #{version}"
end

def set_stripe_product_price

def set_stripe_product_price
  stripe_product  = Stripe::Product.create({ name: "Appliance #{self}" })
  self.product_id = stripe_product.id
end

def to_s

def to_s
  "#{kind}-#{version}"
end

def volume_zip

def volume_zip
  if volume_zip_exe
    eval( volume_zip_exe )
  else
    volume_zip_url
  end
end