Class: Card
- Defined in:
- lib/card/env.rb,
lib/card.rb,
lib/card/log.rb,
lib/card/set.rb,
lib/card/auth.rb,
lib/card/name.rb,
lib/card/cache.rb,
lib/card/chunk.rb,
lib/card/format.rb,
lib/card/loader.rb,
lib/card/mailer.rb,
lib/card/content.rb,
lib/card/codename.rb,
lib/card/view_name.rb,
lib/card/exceptions.rb,
lib/generators/card.rb,
lib/card/set_pattern.rb,
lib/card/query/card_clause.rb,
lib/generators/card/set/set_generator.rb,
lib/generators/card/format/format_generator.rb,
lib/generators/card/migration/migration_generator.rb
Overview
A chunk is a pattern of text that can be protected and interrogated by a format. Each Chunk class has a pattern that states what sort of text it matches. Chunks are initalized by passing in the result of a match by its pattern.
Defined Under Namespace
Modules: Auth, Chunk, Diff, Env, Generators, Loader, Set, SpecHelper, Version Classes: Abort, BadQuery, Cache, Codename, Content, CoreMigration, Error, Format, Log, Mailer, Migration, Name, NotFound, Oops, PermissionDenied, Query, Reference, SetPattern, TypeSet, ViewName
Constant Summary collapse
- TRACKED_FIELDS =
%w(name type_id db_content trash)
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#comment ⇒ Object
Returns the value of attribute comment.
-
#comment_author ⇒ Object
Returns the value of attribute comment_author.
-
#current_act ⇒ Object
Returns the value of attribute current_act.
-
#current_action ⇒ Object
Returns the value of attribute current_action.
-
#follower_stash ⇒ Object
Returns the value of attribute follower_stash.
-
#last_action_id_before_edit ⇒ Object
Returns the value of attribute last_action_id_before_edit.
-
#remove_rule_stash ⇒ Object
Returns the value of attribute remove_rule_stash.
-
#supercard ⇒ Object
Returns the value of attribute supercard.
-
#update_all_users ⇒ Object
Returns the value of attribute update_all_users.
-
#update_referencers ⇒ Object
Returns the value of attribute update_referencers.
Class Method Summary collapse
- .config ⇒ Object
- .const_missing(const) ⇒ Object
- .paths ⇒ Object
- .with_logging(method, opts, &block) ⇒ Object
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
31 32 33 |
# File 'lib/card.rb', line 31 def action @action end |
#comment ⇒ Object
Returns the value of attribute comment.
31 32 33 |
# File 'lib/card.rb', line 31 def comment @comment end |
#comment_author ⇒ Object
Returns the value of attribute comment_author.
31 32 33 |
# File 'lib/card.rb', line 31 def @comment_author end |
#current_act ⇒ Object
Returns the value of attribute current_act.
31 32 33 |
# File 'lib/card.rb', line 31 def current_act @current_act end |
#current_action ⇒ Object
Returns the value of attribute current_action.
31 32 33 |
# File 'lib/card.rb', line 31 def current_action @current_action end |
#follower_stash ⇒ Object
Returns the value of attribute follower_stash.
31 32 33 |
# File 'lib/card.rb', line 31 def follower_stash @follower_stash end |
#last_action_id_before_edit ⇒ Object
Returns the value of attribute last_action_id_before_edit.
31 32 33 |
# File 'lib/card.rb', line 31 def last_action_id_before_edit @last_action_id_before_edit end |
#remove_rule_stash ⇒ Object
Returns the value of attribute remove_rule_stash.
31 32 33 |
# File 'lib/card.rb', line 31 def remove_rule_stash @remove_rule_stash end |
#supercard ⇒ Object
Returns the value of attribute supercard.
31 32 33 |
# File 'lib/card.rb', line 31 def supercard @supercard end |
#update_all_users ⇒ Object
Returns the value of attribute update_all_users.
31 32 33 |
# File 'lib/card.rb', line 31 def update_all_users @update_all_users end |
#update_referencers ⇒ Object
Returns the value of attribute update_referencers.
31 32 33 |
# File 'lib/card.rb', line 31 def update_referencers @update_referencers end |
Class Method Details
.const_missing(const) ⇒ Object
60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/card/codename.rb', line 60 def self.const_missing const if const.to_s =~ /^([A-Z]\S*)ID$/ and code=$1.underscore.to_sym if card_id = Codename[code] const_set const, card_id else raise "Missing codename #{code} (#{const})" end else super end end |
.with_logging(method, opts, &block) ⇒ Object
440 441 442 443 444 445 446 447 448 |
# File 'lib/card/log.rb', line 440 def self.with_logging method, opts, &block if Card::Log::Performance.enabled_method? method Card::Log::Performance.with_timer(method, opts) do block.call end else block.call end end |