Class: Tinypass::Policy

Inherits:
Object
  • Object
show all
Defined in:
lib/tinypass/policies/policy.rb

Direct Known Subclasses

DiscountPolicy, PricingPolicy, RestrictionPolicy

Constant Summary collapse

DISCOUNT_TOTAL_IN_PERIOD =
"d1"
DISCOUNT_PREVIOUS_PURCHASE =
"d2"
STRICT_METER_BY_TIME =
"sm1"
REMINDER_METER_BY_TIME =
"rm1"
REMINDER_METER_BY_COUNT =
"rm2"
RESTRICT_MAX_PURCHASES =
"r1"
POLICY_TYPE =
"type"

Instance Method Summary collapse

Constructor Details

#initializePolicy



12
13
14
# File 'lib/tinypass/policies/policy.rb', line 12

def initialize
  @map = {}
end

Instance Method Details

#[]=(key, value) ⇒ Object



16
17
18
19
# File 'lib/tinypass/policies/policy.rb', line 16

def []=(key,value)
  key = key.to_s
  @map[key] = value
end

#to_hashObject



21
22
23
# File 'lib/tinypass/policies/policy.rb', line 21

def to_hash
  @map
end