Class: TermNote::Pane::Code

Inherits:
Object
  • Object
show all
Includes:
TermNote::Pane
Defined in:
lib/termnote/pane/code.rb

Instance Attribute Summary collapse

Attributes included from TermNote::Pane

#height, #show, #width

Instance Method Summary collapse

Methods included from TermNote::Pane

#call

Constructor Details

#initialize(options) ⇒ Code

Returns a new instance of Code.



8
9
10
11
# File 'lib/termnote/pane/code.rb', line 8

def initialize(options)
  @source = options[:source] || options['source']
  @language = options[:language] || options['language']
end

Instance Attribute Details

#languageObject

Returns the value of attribute language.



6
7
8
# File 'lib/termnote/pane/code.rb', line 6

def language
  @language
end

#sourceObject

Returns the value of attribute source.



6
7
8
# File 'lib/termnote/pane/code.rb', line 6

def source
  @source
end

Instance Method Details

#rowsObject



13
14
15
# File 'lib/termnote/pane/code.rb', line 13

def rows
  highlighted.split("\n")
end