Class: Logaling::Command::Renderers::TermRenderer

Inherits:
Object
  • Object
show all
Defined in:
lib/logaling/command/renderers.rb

Instance Method Summary collapse

Constructor Details

#initialize(term, repository, config, options) ⇒ TermRenderer

Returns a new instance of TermRenderer.



21
22
23
24
25
26
# File 'lib/logaling/command/renderers.rb', line 21

def initialize(term, repository, config, options)
  @term = term
  @repository = repository
  @config = config
  @options = options
end

Instance Method Details

#glossary_nameObject



30
31
32
# File 'lib/logaling/command/renderers.rb', line 30

def glossary_name
  @term[:glossary_name]
end

#noteObject



34
35
36
# File 'lib/logaling/command/renderers.rb', line 34

def note
  @term[:note].to_s unless @term[:note].empty?
end

#render(output) ⇒ Object



28
# File 'lib/logaling/command/renderers.rb', line 28

def render(output); end

#source_termObject



38
39
40
# File 'lib/logaling/command/renderers.rb', line 38

def source_term
  extract_keyword_and_coloring(@term[:snipped_source_term], @term[:source_term])
end

#target_termObject



42
43
44
# File 'lib/logaling/command/renderers.rb', line 42

def target_term
  extract_keyword_and_coloring(@term[:snipped_target_term], @term[:target_term])
end