Module: Lexorank::Rankable::InstanceMethods
- Defined in:
- lib/lexorank/rankable.rb
Instance Method Summary collapse
- #move_to ⇒ Object
- #move_to!(position, **options) ⇒ Object
- #move_to_end ⇒ Object
- #move_to_end!(**options) ⇒ Object
- #move_to_top ⇒ Object
- #move_to_top!(**options) ⇒ Object
- #no_rank? ⇒ Boolean
Instance Method Details
#move_to ⇒ Object
33 34 35 |
# File 'lib/lexorank/rankable.rb', line 33 def move_to(...) self.class.lexorank_ranking.move_to(self, ...) end |
#move_to!(position, **options) ⇒ Object
37 38 39 40 41 |
# File 'lib/lexorank/rankable.rb', line 37 def move_to!(position, **) move_to(position, **) do save end end |
#move_to_end ⇒ Object
29 30 31 |
# File 'lib/lexorank/rankable.rb', line 29 def move_to_end(...) self.class.lexorank_ranking.move_to(self, :last, ...) end |
#move_to_end!(**options) ⇒ Object
49 50 51 52 53 |
# File 'lib/lexorank/rankable.rb', line 49 def move_to_end!(**) move_to_end(**) do save end end |
#move_to_top ⇒ Object
25 26 27 |
# File 'lib/lexorank/rankable.rb', line 25 def move_to_top(...) move_to(0, ...) end |
#move_to_top!(**options) ⇒ Object
43 44 45 46 47 |
# File 'lib/lexorank/rankable.rb', line 43 def move_to_top!(**) move_to_top(**) do save end end |
#no_rank? ⇒ Boolean
55 56 57 |
# File 'lib/lexorank/rankable.rb', line 55 def no_rank? !send(self.class.lexorank_ranking.field) end |