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.



12
13
14
# File 'lib/feedjira/configuration.rb', line 12

def logger
  @logger
end

#parsersObject

Returns the value of attribute parsers.



12
13
14
# File 'lib/feedjira/configuration.rb', line 12

def parsers
  @parsers
end

#strip_whitespaceObject

Returns the value of attribute strip_whitespace.



12
13
14
# File 'lib/feedjira/configuration.rb', line 12

def strip_whitespace
  @strip_whitespace
end

Class Method Details

.extended(base) ⇒ Object



38
39
40
# File 'lib/feedjira/configuration.rb', line 38

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



25
26
27
# File 'lib/feedjira/configuration.rb', line 25

def configure
  yield self
end

#reset_configuration!Object

Reset Feedjira’s configuration to defaults

Examples:

Feedjira.reset_configuration!


33
34
35
# File 'lib/feedjira/configuration.rb', line 33

def reset_configuration!
  set_default_configuration
end

#set_default_configurationObject



43
44
45
46
47
# File 'lib/feedjira/configuration.rb', line 43

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