Class: GithubConcern::Engine
- Inherits:
-
Rails::Engine
- Object
- Rails::Engine
- GithubConcern::Engine
- Defined in:
- lib/github_concern/engine.rb
Constant Summary collapse
- @@github_concerns =
{}
Class Method Summary collapse
- .add_class(class_constant, options) ⇒ Object
- .add_github_concernable_relationship_to_class(class_constant) ⇒ Object
- .config {|_self| ... } ⇒ Object
- .determine_user(email) ⇒ Object
- .github_concerns ⇒ Object
- .user_class ⇒ Object
- .user_class=(user_class_constant) ⇒ Object
- .user_class_symbol ⇒ Object
- .user_lambda ⇒ Object
- .user_lambda=(find_user_lambda) ⇒ Object
Class Method Details
.add_class(class_constant, options) ⇒ Object
9 10 11 |
# File 'lib/github_concern/engine.rb', line 9 def self.add_class(class_constant, ) @@github_concerns[class_constant.to_s] = end |
.add_github_concernable_relationship_to_class(class_constant) ⇒ Object
43 44 45 46 47 48 |
# File 'lib/github_concern/engine.rb', line 43 def self.add_github_concernable_relationship_to_class(class_constant) class_constant.class_eval { has_many :github_concernables, :class_name => "GithubConcernableGitPush", :as => :github_concernable has_many :git_pushes, :through => :github_concernables } end |
.config {|_self| ... } ⇒ Object
5 6 7 |
# File 'lib/github_concern/engine.rb', line 5 def self.config yield(self) end |
.determine_user(email) ⇒ Object
39 40 41 |
# File 'lib/github_concern/engine.rb', line 39 def self.determine_user(email) @@user_lambda.call(email) end |
.github_concerns ⇒ Object
13 14 15 |
# File 'lib/github_concern/engine.rb', line 13 def self.github_concerns @@github_concerns end |
.user_class ⇒ Object
31 32 33 |
# File 'lib/github_concern/engine.rb', line 31 def self.user_class @@user_class end |
.user_class=(user_class_constant) ⇒ Object
25 26 27 28 29 |
# File 'lib/github_concern/engine.rb', line 25 def self.user_class= user_class_constant @@user_class= user_class_constant @@user_class.class_eval { has_many :git_pushes } @@user_class end |
.user_class_symbol ⇒ Object
35 36 37 |
# File 'lib/github_concern/engine.rb', line 35 def self.user_class_symbol @@user_class.try(:to_s).try(:downcase).try(:to_sym) end |
.user_lambda ⇒ Object
21 22 23 |
# File 'lib/github_concern/engine.rb', line 21 def self.user_lambda @@user_lambda end |
.user_lambda=(find_user_lambda) ⇒ Object
17 18 19 |
# File 'lib/github_concern/engine.rb', line 17 def self.user_lambda= find_user_lambda @@user_lambda = find_user_lambda end |