Class: GitPrepareBranch::Configurator::ScreenDSL

Inherits:
Object
  • Object
show all
Defined in:
lib/git-prepare-branch/configurator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(screen) ⇒ ScreenDSL

Returns a new instance of ScreenDSL.



40
41
42
# File 'lib/git-prepare-branch/configurator.rb', line 40

def initialize(screen)
  @screen = screen
end

Instance Attribute Details

#screenObject (readonly)

Returns the value of attribute screen.



38
39
40
# File 'lib/git-prepare-branch/configurator.rb', line 38

def screen
  @screen
end

Instance Method Details

#apply(&block) ⇒ Object



44
45
46
47
48
# File 'lib/git-prepare-branch/configurator.rb', line 44

def apply(&block)
  self.tap do |s|
    instance_exec(&block)
  end
end

#command(*args) ⇒ Object



50
51
52
# File 'lib/git-prepare-branch/configurator.rb', line 50

def command(*args)
  screen.add_command(*args)
end

#description(value) ⇒ Object



54
55
56
# File 'lib/git-prepare-branch/configurator.rb', line 54

def description(value)
  screen.description = value
end

#display(command) ⇒ Object



58
59
60
# File 'lib/git-prepare-branch/configurator.rb', line 58

def display(command)
  screen.display = command
end

#heading(message, options = {}) ⇒ Object



62
63
64
65
# File 'lib/git-prepare-branch/configurator.rb', line 62

def heading(message, options={})
  screen.heading = message
  screen.heading_style = options[:style]
end

#title(value) ⇒ Object



67
68
69
# File 'lib/git-prepare-branch/configurator.rb', line 67

def title(value)
  screen.title = value
end