Class: FCReminder::Reminder

Inherits:
Object
  • Object
show all
Defined in:
lib/fc-reminder/reminder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&customization_block) ⇒ Reminder

Returns a new instance of Reminder.



6
7
8
9
10
# File 'lib/fc-reminder/reminder.rb', line 6

def initialize(&customization_block)
  @provider = Providers::LiveScore.new
  @gateway = Gateways::Twilio.new
  eval_block &customization_block
end

Instance Attribute Details

#gatewayObject

Returns the value of attribute gateway.



3
4
5
# File 'lib/fc-reminder/reminder.rb', line 3

def gateway
  @gateway
end

#providerObject

Returns the value of attribute provider.



3
4
5
# File 'lib/fc-reminder/reminder.rb', line 3

def provider
  @provider
end

#recipientObject

Returns the value of attribute recipient.



4
5
6
# File 'lib/fc-reminder/reminder.rb', line 4

def recipient
  @recipient
end

#team_nameObject

Returns the value of attribute team_name.



4
5
6
# File 'lib/fc-reminder/reminder.rb', line 4

def team_name
  @team_name
end

Instance Method Details

#run(&customization_block) ⇒ Object



28
29
30
31
32
# File 'lib/fc-reminder/reminder.rb', line 28

def run(&customization_block)
  eval_block &customization_block
  result = provider.run(team_name)
  gateway.send(recipient, result) unless result.empty?
end