Class: AcceptOn::PromoCode

Inherits:
Base
  • Object
show all
Defined in:
lib/accepton/promo_code.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from AcceptOn::Base

Instance Attribute Details

#created_atObject (readonly)



9
10
11
# File 'lib/accepton/promo_code.rb', line 9

def created_at
  @created_at
end

#nameObject



21
22
23
# File 'lib/accepton/promo_code.rb', line 21

def name
  @name
end

#original_nameString (readonly)

Gets the original name of the promo code

Returns:

  • (String)

    The original name for the promo code.



9
10
11
# File 'lib/accepton/promo_code.rb', line 9

def original_name
  @original_name
end

#promo_typeObject



21
22
23
# File 'lib/accepton/promo_code.rb', line 21

def promo_type
  @promo_type
end

#valueObject



21
22
23
# File 'lib/accepton/promo_code.rb', line 21

def value
  @value
end

Instance Method Details

#as_paramsHash

Creates a hash representation of the promo code's current values

Returns:

  • (Hash)

    A hash representing the promo code.



26
27
28
# File 'lib/accepton/promo_code.rb', line 26

def as_params
  {name: name, promo_type: promo_type, value: value}
end