class Tinypass::Offer

Attributes

policies[R]
pricing[R]
resource[R]
tags[R]

Public Class Methods

new(resource, *price_options_or_policy) click to toggle source
# File lib/tinypass/offer.rb, line 5
def initialize(resource, *price_options_or_policy)
  raise ArgumentError.new("Can't initialize offer without price options or policy") if price_options_or_policy.empty?

  @resource = resource
  @policies = []
  @tags = []

  if price_options_or_policy.first.kind_of?(PricingPolicy)
    @pricing = price_options_or_policy.first
  else
    @pricing = PricingPolicy.new(price_options_or_policy)
  end
end

Public Instance Methods

has_active_prices?() click to toggle source
# File lib/tinypass/offer.rb, line 19
def has_active_prices?
  pricing.has_active_options?
end