Class: RankedModel::Ranker
- Inherits:
-
Object
- Object
- RankedModel::Ranker
- Defined in:
- lib/ranked-model/ranker.rb
Defined Under Namespace
Classes: Mapper
Instance Attribute Summary collapse
-
#class_name ⇒ Object
Returns the value of attribute class_name.
-
#column ⇒ Object
Returns the value of attribute column.
-
#name ⇒ Object
Returns the value of attribute name.
-
#scope ⇒ Object
Returns the value of attribute scope.
-
#unless ⇒ Object
Returns the value of attribute unless.
-
#with_same ⇒ Object
Returns the value of attribute with_same.
Instance Method Summary collapse
-
#initialize(name, options = {}) ⇒ Ranker
constructor
A new instance of Ranker.
- #with(instance) ⇒ Object
Constructor Details
#initialize(name, options = {}) ⇒ Ranker
Returns a new instance of Ranker.
9 10 11 12 13 14 15 16 17 |
# File 'lib/ranked-model/ranker.rb', line 9 def initialize name, ={} self.name = name.to_sym self.column = [:column] || name self.class_name = [:class_name] [ :scope, :with_same, :unless ].each do |key| self.send "#{key}=", [key] end end |
Instance Attribute Details
#class_name ⇒ Object
Returns the value of attribute class_name.
7 8 9 |
# File 'lib/ranked-model/ranker.rb', line 7 def class_name @class_name end |
#column ⇒ Object
Returns the value of attribute column.
7 8 9 |
# File 'lib/ranked-model/ranker.rb', line 7 def column @column end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/ranked-model/ranker.rb', line 7 def name @name end |
#scope ⇒ Object
Returns the value of attribute scope.
7 8 9 |
# File 'lib/ranked-model/ranker.rb', line 7 def scope @scope end |
#unless ⇒ Object
Returns the value of attribute unless.
7 8 9 |
# File 'lib/ranked-model/ranker.rb', line 7 def unless @unless end |
#with_same ⇒ Object
Returns the value of attribute with_same.
7 8 9 |
# File 'lib/ranked-model/ranker.rb', line 7 def with_same @with_same end |