Module: Card::Set::All::Comment
- Extended by:
- Card::Set
- Defined in:
- platypus/tmp/set/gem-defaults/mod025-comment/all/comment.rb
Overview
Set: All cards (Comment)
Defined Under Namespace
Modules: Format
Constant Summary
Constants included from Helpers
Helpers::SET_PATTERN_TEST_REGEXP
Constants included from Event::Api
Instance Attribute Summary collapse
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Card::Set
Methods included from I18nScope
Methods included from Registrar
#extended, #finalize_load, #process_base_modules, #register_set
Methods included from Helpers
#format_module, #format_modules, #method_missing, #modules, #pattern_code, #respond_to_missing?, #set_name_parts, #shortname, #underscored_name
Methods included from Card::Set::AdvancedApi
#assign_type, #attachment, #define_set_from_error, #ensure_set, #setting_opts, #stage_method
Methods included from Format
#before, #format, layout_method_name, #view, view_method_name, view_setting_method_name, wrapper_method_name
Methods included from Inheritance
#include_set, #include_set_formats
Methods included from Trait
#card_accessor, #card_reader, #card_writer, #require_field
Methods included from Event::Api
Instance Attribute Details
Class Method Details
.source_location ⇒ Object
7 |
# File 'platypus/tmp/set/gem-defaults/mod025-comment/all/comment.rb', line 7 def self.source_location; "/Users/ethan/dev/decko/gem/mod/comment/set/all/comment.rb"; end |
Instance Method Details
#clean_comment ⇒ Object
28 29 30 31 32 |
# File 'platypus/tmp/set/gem-defaults/mod025-comment/all/comment.rb', line 28 def clean_comment comment.split(/\n/).map do |line| "<p>#{line.strip.empty? ? ' ' : line}</p>" end * "\n" end |
#commenting? ⇒ Boolean
8 9 10 |
# File 'platypus/tmp/set/gem-defaults/mod025-comment/all/comment.rb', line 8 def commenting? comment && action != :delete end |
#event: add_comment ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'platypus/tmp/set/gem-defaults/mod025-comment/all/comment.rb', line 12 event :add_comment, :prepare_to_store, on: :save, when: :comment do Env.session[:comment_author] = if Env.session return unless comment.present? self.content = [content, format.comment_with_signature].compact.join "\n<hr\>\n" self.comment = nil end |