Class: Payment::Manager::Plan

Inherits:
Object
  • Object
show all
Defined in:
lib/payment/manager/plan.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = nil) ⇒ Plan

Returns a new instance of Plan.



13
14
15
16
17
# File 'lib/payment/manager/plan.rb', line 13

def initialize(args = nil)
  args&.each do |k, v|
    instance_variable_set("@#{k}", v) unless v.nil?
  end
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



7
8
9
# File 'lib/payment/manager/plan.rb', line 7

def description
  @description
end

#detailsObject

Returns the value of attribute details.



11
12
13
# File 'lib/payment/manager/plan.rb', line 11

def details
  @details
end

#duration_in_monthsObject

Returns the value of attribute duration_in_months.



10
11
12
# File 'lib/payment/manager/plan.rb', line 10

def duration_in_months
  @duration_in_months
end

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/payment/manager/plan.rb', line 5

def id
  @id
end

#installmentsObject

Returns the value of attribute installments.



9
10
11
# File 'lib/payment/manager/plan.rb', line 9

def installments
  @installments
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/payment/manager/plan.rb', line 6

def name
  @name
end

#priceObject

Returns the value of attribute price.



8
9
10
# File 'lib/payment/manager/plan.rb', line 8

def price
  @price
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
22
23
24
# File 'lib/payment/manager/plan.rb', line 19

def eql?(other)
  id == other.id &&
    name == other.name &&
    description == other.description &&
    price == other.price
end