Sha256: 2b360f6480f914c87fb25e8599a95f6c07cea037fa434feb3fd6791281f14387
Contents?: true
Size: 1.36 KB
Versions: 17
Compression:
Stored size: 1.36 KB
Contents
module Stripe module Products include ConfigurationBuilder configuration_for :product do attr_accessor :name, :type, :active, :attributes, :description, :caption, :metadata, :shippable, :unit_label, :url, :statement_descriptor validates_presence_of :name, :type validates :statement_descriptor, length: { maximum: 22 } validates :active, :shippable, inclusion: { in: [true, false] }, allow_nil: true validates :type, inclusion: { in: %w(service good) } validates :caption, :description, :shippable, :url, absence: true, unless: :good? validates :statement_descriptor, absence: true, unless: :service? private def good? type == 'good' end def service? type == 'service' end def create_options { name: name, type: type, active: active, attributes: attributes, description: description, caption: caption, metadata: metadata, shippable: shippable, unit_label: unit_label, url: url, statement_descriptor: statement_descriptor } end end end end
Version data entries
17 entries across 17 versions & 1 rubygems