Class: BaseProvider Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/cal_invite/providers/base_provider.rb

Overview

This class is abstract.

Subclass and override #generate to implement a calendar provider

app/lib/base_provider.rb Base class for calendar providers that implements common functionality and defines the interface that all providers must implement.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event) ⇒ BaseProvider

Initialize a new calendar provider



14
15
16
# File 'lib/cal_invite/providers/base_provider.rb', line 14

def initialize(event)
  @event = event
end

Instance Attribute Details

#eventObject (readonly)

Returns the value of attribute event.



9
10
11
# File 'lib/cal_invite/providers/base_provider.rb', line 9

def event
  @event
end

Instance Method Details

#generateString

This method is abstract.

Generate a calendar URL or content for the event. This method must be implemented by all provider subclasses.

Raises:

  • (NotImplementedError)

    if the provider class doesn’t implement this method



24
25
26
# File 'lib/cal_invite/providers/base_provider.rb', line 24

def generate
  raise NotImplementedError, "#{self.class} must implement #generate"
end