Class: LogMaster::Configuration

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/log_master/configuration.rb

Constant Summary collapse

@@configured =
false

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



14
15
16
# File 'lib/log_master/configuration.rb', line 14

def initialize
  reset
end

Instance Attribute Details

#failure_conditionsObject

Returns the value of attribute failure_conditions.



7
8
9
# File 'lib/log_master/configuration.rb', line 7

def failure_conditions
  @failure_conditions
end

#fromObject

These are options that directly affect the email



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

def from
  @from
end

#recipientsObject

These are options that directly affect the email



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

def recipients
  @recipients
end

#reply_toObject

These are options that directly affect the email



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

def reply_to
  @reply_to
end

#reportingObject

Returns the value of attribute reporting.



7
8
9
# File 'lib/log_master/configuration.rb', line 7

def reporting
  @reporting
end

#titleObject

Returns the value of attribute title.



7
8
9
# File 'lib/log_master/configuration.rb', line 7

def title
  @title
end

Class Method Details

.configure {|instance| ... } ⇒ Object

Yields:

  • (instance)


26
27
28
29
# File 'lib/log_master/configuration.rb', line 26

def self.configure
  yield instance
  @@configured = true
end

.configured?Boolean

Returns:

  • (Boolean)


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

def self.configured?
  @@configured === true
end

Instance Method Details

#resetObject



18
19
20
21
22
23
24
# File 'lib/log_master/configuration.rb', line 18

def reset
  @title = "No Title"
  @reporting = {}
  @failure_conditions = []
  
  @@configured = false
end

#reset_configured_status!Object

For testing purposes



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

def reset_configured_status!
  @@configured = false
end