Class: Chamomile::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/chamomile/configuration.rb

Overview

Block-style configuration for Chamomile.run.

Chamomile.run(MyApp.new) do |config|
config.alt_screen = true
config.mouse      = :cell_motion
config.fps        = 30
end

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



15
16
17
18
19
20
21
22
# File 'lib/chamomile/configuration.rb', line 15

def initialize
  @alt_screen      = true
  @mouse           = :none
  @bracketed_paste = true
  @report_focus    = false
  @fps             = 60
  @catch_panics    = true
end

Instance Attribute Details

#alt_screenObject

Returns the value of attribute alt_screen.



12
13
14
# File 'lib/chamomile/configuration.rb', line 12

def alt_screen
  @alt_screen
end

#bracketed_pasteObject

Returns the value of attribute bracketed_paste.



12
13
14
# File 'lib/chamomile/configuration.rb', line 12

def bracketed_paste
  @bracketed_paste
end

#catch_panicsObject

Returns the value of attribute catch_panics.



12
13
14
# File 'lib/chamomile/configuration.rb', line 12

def catch_panics
  @catch_panics
end

#fpsObject

Returns the value of attribute fps.



12
13
14
# File 'lib/chamomile/configuration.rb', line 12

def fps
  @fps
end

#mouseObject

Returns the value of attribute mouse.



12
13
14
# File 'lib/chamomile/configuration.rb', line 12

def mouse
  @mouse
end

#report_focusObject

Returns the value of attribute report_focus.



12
13
14
# File 'lib/chamomile/configuration.rb', line 12

def report_focus
  @report_focus
end

Instance Method Details

#to_hObject



24
25
26
27
28
29
30
31
32
33
# File 'lib/chamomile/configuration.rb', line 24

def to_h
  {
    alt_screen: @alt_screen,
    mouse: @mouse,
    bracketed_paste: @bracketed_paste,
    report_focus: @report_focus,
    fps: @fps,
    catch_panics: @catch_panics,
  }
end