Module: Card::Set::All::Comment

Extended by:
Card::Set
Defined in:
tmpsets/set/mod021-standard/all/comment.rb

Overview

Set: All cards (Comment)

Defined Under Namespace

Modules: Format

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from I18nScope

#mod_name, #scope

Methods included from Loader

#clean_empty_module_from_hash, #clean_empty_modules, #extended, #process_base_modules, #register_set

Methods included from Helpers

#abstract_set?, #all_set?, #num_set_parts, #shortname, #underscore

Methods included from Card::Set::AdvancedApi

#attachment, #ensure_set, #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 Basket

#abstract_basket, #add_to_basket, #basket, #unshift_basket

Methods included from Trait

#card_accessor, #card_reader, #card_writer, #require_field

Methods included from Event::Api

#event

Instance Attribute Details

#comment_authorObject



21
22
23
24
# File 'tmpsets/set/mod021-standard/all/comment.rb', line 21

def comment_author
  @comment_author ||=
    Env.session[:comment_author] || Env.params[:comment_author] || "Anonymous"
end

Class Method Details

.source_locationObject



7
# File 'tmpsets/set/mod021-standard/all/comment.rb', line 7

def self.source_location; "/Users/ethan/dev/decko/gem/card/mod/standard/set/all/comment.rb"; end

Instance Method Details

#clean_commentObject



26
27
28
29
30
# File 'tmpsets/set/mod021-standard/all/comment.rb', line 26

def clean_comment
  comment.split(/\n/).map do |line|
    "<p>#{line.strip.empty? ? '&nbsp;' : line}</p>"
  end * "\n"
end

#commenting?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'tmpsets/set/mod021-standard/all/comment.rb', line 8

def commenting?
  comment && @action != :delete
end