Class: Unit::Types::CreateSchedule

Inherits:
Object
  • Object
show all
Defined in:
lib/unit/types/create_schedule.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(interval, day_of_month, day_of_week = nil, start_time = nil, end_time = nil, total_number_of_payments = nil) ⇒ CreateSchedule

Returns a new instance of CreateSchedule.

Parameters:

  • interval (String)
  • day_of_month (Integer)
  • day_of_week (String) (defaults to: nil)
    • optional

  • start_time (String) (defaults to: nil)
    • optional

  • end_time (String) (defaults to: nil)
    • optional

  • total_number_of_payments (Integer) (defaults to: nil)
    • optional



16
17
18
19
20
21
22
23
# File 'lib/unit/types/create_schedule.rb', line 16

def initialize(interval, day_of_month, day_of_week = nil, start_time = nil, end_time = nil, total_number_of_payments = nil)
  @interval = interval
  @day_of_month = day_of_month
  @day_of_week = day_of_week
  @start_time = start_time
  @end_time = end_time
  @total_number_of_payments = total_number_of_payments
end

Instance Attribute Details

#day_of_monthObject (readonly)

Returns the value of attribute day_of_month.



8
9
10
# File 'lib/unit/types/create_schedule.rb', line 8

def day_of_month
  @day_of_month
end

#day_of_weekObject (readonly)

Returns the value of attribute day_of_week.



8
9
10
# File 'lib/unit/types/create_schedule.rb', line 8

def day_of_week
  @day_of_week
end

#end_timeObject (readonly)

Returns the value of attribute end_time.



8
9
10
# File 'lib/unit/types/create_schedule.rb', line 8

def end_time
  @end_time
end

#intervalObject (readonly)

Returns the value of attribute interval.



8
9
10
# File 'lib/unit/types/create_schedule.rb', line 8

def interval
  @interval
end

#start_timeObject (readonly)

Returns the value of attribute start_time.



8
9
10
# File 'lib/unit/types/create_schedule.rb', line 8

def start_time
  @start_time
end

#total_number_of_paymentsObject (readonly)

Returns the value of attribute total_number_of_payments.



8
9
10
# File 'lib/unit/types/create_schedule.rb', line 8

def total_number_of_payments
  @total_number_of_payments
end

Instance Method Details

#representObject



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/unit/types/create_schedule.rb', line 25

def represent
  payload = {
    interval: interval,
    dayOfMonth: day_of_month,
    dayOfWeek: day_of_week,
    startTime: start_time,
    endTime: end_time,
    totalNumberOfPayments: total_number_of_payments
  }
  payload.compact!
end