Class: Rumbrl::Factory
- Inherits:
-
Object
- Object
- Rumbrl::Factory
- Defined in:
- lib/rumbrl/factory.rb
Overview
an insanely dumb logger creator broken regulations & underaged workers abound
Instance Attribute Summary collapse
-
#age ⇒ Object
Returns the value of attribute age.
-
#data_format ⇒ Object
Returns the value of attribute data_format.
-
#dest ⇒ Object
readonly
Returns the value of attribute dest.
-
#level ⇒ Object
Returns the value of attribute level.
-
#log_format ⇒ Object
Returns the value of attribute log_format.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#size ⇒ Object
Returns the value of attribute size.
-
#time_format ⇒ Object
Returns the value of attribute time_format.
Class Method Summary collapse
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(nm, path: nil, age: nil, size: nil, level: nil) ⇒ Factory
constructor
A new instance of Factory.
Constructor Details
#initialize(nm, path: nil, age: nil, size: nil, level: nil) ⇒ Factory
Returns a new instance of Factory.
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/rumbrl/factory.rb', line 15 def initialize(nm, path: nil, age: nil, size: nil, level: nil) @name = nm @log_format = Env.log_format @data_format = Env.data_format @time_format = Env.time_format @size ||= (size || Env.shift_size) @age ||= (age || Env.shift_age) @level ||= (level || ::Logger::INFO) @dest = log_dest path, nm end |
Instance Attribute Details
#age ⇒ Object
Returns the value of attribute age.
9 10 11 |
# File 'lib/rumbrl/factory.rb', line 9 def age @age end |
#data_format ⇒ Object
Returns the value of attribute data_format.
9 10 11 |
# File 'lib/rumbrl/factory.rb', line 9 def data_format @data_format end |
#dest ⇒ Object (readonly)
Returns the value of attribute dest.
8 9 10 |
# File 'lib/rumbrl/factory.rb', line 8 def dest @dest end |
#level ⇒ Object
Returns the value of attribute level.
9 10 11 |
# File 'lib/rumbrl/factory.rb', line 9 def level @level end |
#log_format ⇒ Object
Returns the value of attribute log_format.
9 10 11 |
# File 'lib/rumbrl/factory.rb', line 9 def log_format @log_format end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/rumbrl/factory.rb', line 8 def name @name end |
#size ⇒ Object
Returns the value of attribute size.
9 10 11 |
# File 'lib/rumbrl/factory.rb', line 9 def size @size end |
#time_format ⇒ Object
Returns the value of attribute time_format.
9 10 11 |
# File 'lib/rumbrl/factory.rb', line 9 def time_format @time_format end |
Class Method Details
.create(nm, path: nil, age: nil, size: nil, level: nil) ⇒ Object
11 12 13 |
# File 'lib/rumbrl/factory.rb', line 11 def self.create(nm, path: nil, age: nil, size: nil, level: nil) new(nm, path: path, age: age, size: size, level: level).generate end |
Instance Method Details
#generate ⇒ Object
26 27 28 29 |
# File 'lib/rumbrl/factory.rb', line 26 def generate init_path dest generate_logger end |