Class: Eventify
- Inherits:
-
Object
- Object
- Eventify
- Defined in:
- lib/eventify.rb,
lib/eventify/version.rb,
lib/eventify/provider/base.rb
Defined Under Namespace
Modules: Provider Classes: Configuration, Database, Mail
Constant Summary collapse
- VERSION =
"4.0.0"
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
- #providers ⇒ Object
Instance Method Summary collapse
- #all_events ⇒ Object
-
#initialize(configuration = Eventify::Configuration.new) ⇒ Eventify
constructor
A new instance of Eventify.
- #new_events ⇒ Object
- #process_new_events ⇒ Object
Constructor Details
#initialize(configuration = Eventify::Configuration.new) ⇒ Eventify
Returns a new instance of Eventify.
13 14 15 |
# File 'lib/eventify.rb', line 13 def initialize(configuration=Eventify::Configuration.new) @configuration = configuration end |
Instance Attribute Details
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
11 12 13 |
# File 'lib/eventify.rb', line 11 def configuration @configuration end |
#providers ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/eventify.rb', line 35 def providers @providers ||= [ Eventify::Provider::Piletilevi, Eventify::Provider::Livenation, Eventify::Provider::ApolloKino ] end |
Instance Method Details
#all_events ⇒ Object
17 18 19 |
# File 'lib/eventify.rb', line 17 def all_events @all_events ||= providers.flat_map(&:fetch).uniq end |
#new_events ⇒ Object
21 22 23 |
# File 'lib/eventify.rb', line 21 def new_events @new_events ||= all_events.reject(&:exists?) end |