Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/mysh/globalize.rb,
lib/mysh/handlebars.rb,
lib/mysh/expression/lineage.rb,
lib/mysh/internal/format/object.rb
Overview
-
internal/format/object.rb - Support for displaying data formatted neatly.
Constant Summary collapse
Instance Method Summary collapse
-
#eval_handlebar_file(name, evaluator) ⇒ Object
Expand a file with embedded ruby handlebars.
-
#format_description(max_width) ⇒ Object
Create a bullet point description from this object.
-
#lineage ⇒ Object
Get the lineage of this object.
-
#prepare_bullet_data ⇒ Object
Get data ready for being in a bullet point.
-
#show_handlebar_file(name, evaluator = $mysh_exec_host) ⇒ Object
Show a file with embedded ruby handlebars.
Instance Method Details
#eval_handlebar_file(name, evaluator) ⇒ Object
Expand a file with embedded ruby handlebars.
Note: The message receiver is the evaluation host for the handlebar code.
Endemic Code Smells
-
:reek:UtilityFunction
20 21 22 |
# File 'lib/mysh/handlebars.rb', line 20 def (name, evaluator) IO.read(name).preprocess(evaluator) end |
#format_description(max_width) ⇒ Object
Create a bullet point description from this object.
7 8 9 |
# File 'lib/mysh/internal/format/object.rb', line 7 def format_description(max_width) self.to_s.format_description(max_width) end |
#lineage ⇒ Object
Get the lineage of this object.
7 8 9 10 |
# File 'lib/mysh/expression/lineage.rb', line 7 def lineage klass = self.class to_s + " of " + klass.lineage end |
#prepare_bullet_data ⇒ Object
Get data ready for being in a bullet point.
12 13 14 |
# File 'lib/mysh/internal/format/object.rb', line 12 def prepare_bullet_data ["*", self] end |
#show_handlebar_file(name, evaluator = $mysh_exec_host) ⇒ Object
Show a file with embedded ruby handlebars.
Note: The message receiver is the evaluation host for the handlebar code.
11 12 13 |
# File 'lib/mysh/handlebars.rb', line 11 def (name, evaluator = $mysh_exec_host) puts (name, evaluator) end |