class HammerCLI::Help::AbstractItem
Constants
- INDENT_STEP
Attributes
definition[RW]
id[R]
richtext[R]
Public Class Methods
indent(content, indentation = nil)
click to toggle source
# File lib/hammer_cli/help/definition/abstract_item.rb, line 19 def self.indent(content, indentation = nil) indentation ||= ' ' * INDENT_STEP content = content.split("\n") unless content.is_a? Array content.map do |line| (indentation + line).rstrip end.join("\n") end
new(options = {})
click to toggle source
# File lib/hammer_cli/help/definition/abstract_item.rb, line 9 def initialize(options = {}) @id = options[:id] @indentation = options[:indentation] @richtext = options[:richtext] || false end
Public Instance Methods
build_string()
click to toggle source
# File lib/hammer_cli/help/definition/abstract_item.rb, line 15 def build_string raise NotImplementedError end
Protected Instance Methods
build_definition(content)
click to toggle source
# File lib/hammer_cli/help/definition/abstract_item.rb, line 29 def build_definition(content) raise NotImplementedError end
indent(content, indentation = nil)
click to toggle source
# File lib/hammer_cli/help/definition/abstract_item.rb, line 33 def indent(content, indentation = nil) indentation ||= @indentation self.class.indent(content, indentation) end