Module: Scoreable
- Defined in:
- lib/scoreable.rb,
lib/scoreable/scoreable.rb,
lib/scoreable/receiver/active_record.rb,
lib/scoreable/generator/active_record.rb,
lib/generators/scoreable/config_generator.rb,
lib/generators/scoreable/install_generator.rb
Defined Under Namespace
Modules: Generator, Generators, Receiver
Classes: ConfigGenerator
Constant Summary
collapse
- @@score_term =
'score'
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.config {|_self| ... } ⇒ Object
11
12
13
|
# File 'lib/scoreable.rb', line 11
def config
yield self
end
|
.model_name ⇒ Object
19
20
21
|
# File 'lib/scoreable.rb', line 19
def model_name
score_term.camelize
end
|
.score_generator_name ⇒ Object
27
28
29
|
# File 'lib/scoreable.rb', line 27
def score_generator_name
"#{score_term}_generator"
end
|
.score_receiver_name ⇒ Object
23
24
25
|
# File 'lib/scoreable.rb', line 23
def score_receiver_name
"#{score_term}_receiver"
end
|
.table_name ⇒ Object
15
16
17
|
# File 'lib/scoreable.rb', line 15
def table_name
score_term.tableize
end
|
Instance Method Details
#score_term=(term) ⇒ Object
6
7
8
|
# File 'lib/scoreable.rb', line 6
def score_term=(term)
@@score_term = term.to_s.downcase
end
|