Class: Humr::Config
- Inherits:
-
Object
- Object
- Humr::Config
- Defined in:
- lib/humr/config.rb
Constant Summary collapse
- DEFAULT =
{ :handlers => [ :url, :si, :time, :ua ], :handler => { :url => { :color => :green }, :si => { :color => :cyan }, :time => { :color => :yellow }, :ua => { :color => :magenta }, } }
- COLORS =
[ :red, :green, :yellow, :blue, :magenta, :cyan ]
Instance Method Summary collapse
- #color(handler) ⇒ Object
- #handlers ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
Instance Method Details
#color(handler) ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/humr/config.rb', line 32 def color(handler) name = if handler.kind_of?(Symbol) handler else handler.name end @config[:handler][name][:color] end |
#handlers ⇒ Object
28 29 30 |
# File 'lib/humr/config.rb', line 28 def handlers @config[:handlers].map(&:to_sym) end |