Class: Aristotle::Presenter
- Inherits:
-
Object
- Object
- Aristotle::Presenter
- Defined in:
- lib/aristotle/presenter.rb
Instance Method Summary collapse
- #html_rules(show_code: true) ⇒ Object
-
#initialize(klass) ⇒ Presenter
constructor
A new instance of Presenter.
Constructor Details
#initialize(klass) ⇒ Presenter
Returns a new instance of Presenter.
3 4 5 |
# File 'lib/aristotle/presenter.rb', line 3 def initialize(klass) @klass = klass end |
Instance Method Details
#html_rules(show_code: true) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/aristotle/presenter.rb', line 7 def html_rules(show_code: true) @klass.commands.map do |command_title, commands| "<strong>#{command_title}</strong>"+ "<ul>"+ commands.map do |command| "<li>"+ format_fragment(command, :action, show_code: show_code)+ " <strong style='color:blue'>IF</strong> "+ format_fragment(command, :condition, show_code: show_code)+ "</li>" end.join + "</ul>" end.join('<br>').html_safe end |