Module: Coach4rb::Mixin::Iterable::InstanceMethods
- Defined in:
- lib/coach4rb/mixin/iterable.rb
Instance Method Summary collapse
Instance Method Details
#has_next? ⇒ Boolean
13 14 15 16 |
# File 'lib/coach4rb/mixin/iterable.rb', line 13 def has_next? link = self.next link ? link[:href] : false end |
#has_previous? ⇒ Boolean
24 25 26 27 |
# File 'lib/coach4rb/mixin/iterable.rb', line 24 def has_previous? link = previous link ? link[:href] : false end |
#next ⇒ Object
19 20 21 |
# File 'lib/coach4rb/mixin/iterable.rb', line 19 def next links.detect { |link| link[:description] == 'next'} end |
#previous ⇒ Object
30 31 32 |
# File 'lib/coach4rb/mixin/iterable.rb', line 30 def previous links.detect { |link| link[:description] == 'previous'} end |