Class: XRayMachine::Config
- Inherits:
-
Object
- Object
- XRayMachine::Config
- Defined in:
- lib/x_ray_machine/config.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
readonly
Returns the value of attribute color.
-
#show_in_summary ⇒ Object
(also: #show_in_summary?)
readonly
Returns the value of attribute show_in_summary.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(title, color, show_in_summary) ⇒ Config
constructor
A new instance of Config.
- #to_h ⇒ Object
Constructor Details
#initialize(title, color, show_in_summary) ⇒ Config
Returns a new instance of Config.
64 65 66 67 68 |
# File 'lib/x_ray_machine/config.rb', line 64 def initialize(title, color, show_in_summary) @title = title @color = XRayMachine::Options::COLORS[color] || XRayMachine::Options::COLORS[:red] @show_in_summary = show_in_summary end |
Instance Attribute Details
#color ⇒ Object (readonly)
Returns the value of attribute color.
53 54 55 |
# File 'lib/x_ray_machine/config.rb', line 53 def color @color end |
#show_in_summary ⇒ Object (readonly) Also known as: show_in_summary?
Returns the value of attribute show_in_summary.
53 54 55 |
# File 'lib/x_ray_machine/config.rb', line 53 def show_in_summary @show_in_summary end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
53 54 55 |
# File 'lib/x_ray_machine/config.rb', line 53 def title @title end |
Class Method Details
.for(stream) ⇒ Object
55 56 57 58 59 60 61 62 |
# File 'lib/x_ray_machine/config.rb', line 55 def self.for(stream) = XRayMachine..__send__ stream title = [:title] color = [:color] show_in_summary = [:show_in_summary] new title, color, show_in_summary end |
Instance Method Details
#to_h ⇒ Object
72 73 74 |
# File 'lib/x_ray_machine/config.rb', line 72 def to_h {title: title, color: color, show_in_summary: show_in_summary} end |