Module: Feedjira::Configuration

Included in:
Feedjira
Defined in:
lib/feedjira/configuration.rb

Overview

Provides global configuration options for Feedjira

Examples:

Set configuration options using a block

Feedjira.configure do |config|
  config.strip_whitespace = true
end

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#loggerObject

Returns the value of attribute logger


10
11
12
# File 'lib/feedjira/configuration.rb', line 10

def logger
  @logger
end

#parsersObject

Returns the value of attribute parsers


10
11
12
# File 'lib/feedjira/configuration.rb', line 10

def parsers
  @parsers
end

Class Method Details

.extended(base) ⇒ Object


36
37
38
# File 'lib/feedjira/configuration.rb', line 36

def self.extended(base)
  base.set_default_configuration
end

Instance Method Details

#configure {|config| ... } ⇒ Object

Modify Feedjira's current configuration

Examples:

Feedjira.configure do |config|
  config.strip_whitespace = true
end

Yield Parameters:

  • config (Feedjria)

    current Feedjira config


23
24
25
# File 'lib/feedjira/configuration.rb', line 23

def configure
  yield self
end

#reset_configuration!Object

Reset Feedjira's configuration to defaults

Examples:

Feedjira.reset_configuration!

31
32
33
# File 'lib/feedjira/configuration.rb', line 31

def reset_configuration!
  set_default_configuration
end

#set_default_configurationObject


41
42
43
44
45
# File 'lib/feedjira/configuration.rb', line 41

def set_default_configuration
  self.logger = default_logger
  self.parsers = default_parsers
  self.strip_whitespace = false
end