Class: GlTail::Screen
- Inherits:
-
Object
- Object
- GlTail::Screen
- Includes:
- Configurable
- Defined in:
- lib/gl_tail/config.rb
Instance Attribute Summary collapse
-
#aspect ⇒ Object
Returns the value of attribute aspect.
-
#bitmap_mode ⇒ Object
Returns the value of attribute bitmap_mode.
-
#line_size ⇒ Object
Returns the value of attribute line_size.
-
#top ⇒ Object
Returns the value of attribute top.
Instance Method Summary collapse
- #dimensions=(dim) ⇒ Object
-
#initialize(config) ⇒ Screen
constructor
A new instance of Screen.
- #left ⇒ Object
- #right ⇒ Object
- #set_dim(x, y) ⇒ Object
Methods included from Configurable
#config_rewrite_color, included
Constructor Details
#initialize(config) ⇒ Screen
Returns a new instance of Screen.
38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/gl_tail/config.rb', line 38 def initialize(config) @config = config @wanted_fps = 0 @aspect = 0.6 @bounce = false @top = 0.9 @line_size = 0.03 @bitmap_mode = 0 @mode = 0 @highlight_color = [1.0, 0.0, 0.0, 1.0] end |
Instance Attribute Details
#aspect ⇒ Object
Returns the value of attribute aspect.
36 37 38 |
# File 'lib/gl_tail/config.rb', line 36 def aspect @aspect end |
#bitmap_mode ⇒ Object
Returns the value of attribute bitmap_mode.
36 37 38 |
# File 'lib/gl_tail/config.rb', line 36 def bitmap_mode @bitmap_mode end |
#line_size ⇒ Object
Returns the value of attribute line_size.
36 37 38 |
# File 'lib/gl_tail/config.rb', line 36 def line_size @line_size end |
#top ⇒ Object
Returns the value of attribute top.
36 37 38 |
# File 'lib/gl_tail/config.rb', line 36 def top @top end |
Instance Method Details
#dimensions=(dim) ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/gl_tail/config.rb', line 58 def dimensions=(dim) if dim.is_a?(String) case dim when /^(\d+)x(\d+)$/ set_dim $1, $2 when /^(\d+), (\d+)$/ set_dim $1, $2 else raise "dimensions not understood #{dim}, please use <width>x<height> or <width>, <height>" end else raise "what are you #{dim.inspect}" end end |
#left ⇒ Object
77 78 79 |
# File 'lib/gl_tail/config.rb', line 77 def left @left ||= Column.new(@config, :left) end |
#right ⇒ Object
73 74 75 |
# File 'lib/gl_tail/config.rb', line 73 def right @right ||= Column.new(@config, :right) end |
#set_dim(x, y) ⇒ Object
52 53 54 55 |
# File 'lib/gl_tail/config.rb', line 52 def set_dim(x, y) self.window_width = x.to_i self.window_height = y.to_i end |