Class: GitSpelunk::UI::RepoWindow
- Inherits:
-
Object
- Object
- GitSpelunk::UI::RepoWindow
- Defined in:
- lib/git_spelunk/ui/repo.rb
Instance Attribute Summary collapse
-
#command_buffer ⇒ Object
Returns the value of attribute command_buffer.
-
#command_mode ⇒ Object
Returns the value of attribute command_mode.
-
#content ⇒ Object
Returns the value of attribute content.
Instance Method Summary collapse
- #draw ⇒ Object
-
#initialize(height) ⇒ RepoWindow
constructor
A new instance of RepoWindow.
Constructor Details
#initialize(height) ⇒ RepoWindow
Returns a new instance of RepoWindow.
6 7 8 9 |
# File 'lib/git_spelunk/ui/repo.rb', line 6 def initialize(height) @height = height self.content = "" end |
Instance Attribute Details
#command_buffer ⇒ Object
Returns the value of attribute command_buffer.
4 5 6 |
# File 'lib/git_spelunk/ui/repo.rb', line 4 def command_buffer @command_buffer end |
#command_mode ⇒ Object
Returns the value of attribute command_mode.
4 5 6 |
# File 'lib/git_spelunk/ui/repo.rb', line 4 def command_mode @command_mode end |
#content ⇒ Object
Returns the value of attribute content.
4 5 6 |
# File 'lib/git_spelunk/ui/repo.rb', line 4 def content @content end |
Instance Method Details
#draw ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/git_spelunk/ui/repo.rb', line 11 def draw styles = Dispel::StyleMap.new(@height) styles.add(:reverse, 0, 0..999) view = [status_line] + content.split("\n") view = Array.new(@height).each_with_index.map {|_,i| view[i] } [view, styles] end |