Class: Card

Inherits:
ActiveRecord::Base
  • Object
show all
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

Class Method Summary collapse

Instance Attribute Details

#actionObject

Returns the value of attribute action.



31
32
33
# File 'lib/card.rb', line 31

def action
  @action
end

#commentObject

Returns the value of attribute comment.



31
32
33
# File 'lib/card.rb', line 31

def comment
  @comment
end

#comment_authorObject

Returns the value of attribute comment_author.



31
32
33
# File 'lib/card.rb', line 31

def comment_author
  @comment_author
end

#current_actObject

Returns the value of attribute current_act.



31
32
33
# File 'lib/card.rb', line 31

def current_act
  @current_act
end

#current_actionObject

Returns the value of attribute current_action.



31
32
33
# File 'lib/card.rb', line 31

def current_action
  @current_action
end

#follower_stashObject

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_editObject

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_stashObject

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

#supercardObject

Returns the value of attribute supercard.



31
32
33
# File 'lib/card.rb', line 31

def supercard
  @supercard
end

#update_all_usersObject

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_referencersObject

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

.configObject



8
9
10
# File 'lib/card/loader.rb', line 8

def config
  Cardio.config
end

.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

.pathsObject



12
13
14
# File 'lib/card/loader.rb', line 12

def paths
  Cardio.paths
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