lib/neat_pages/helpers/status.rb in neat-pages-0.1.7 vs lib/neat_pages/helpers/status.rb in neat-pages-1.0.0

- old
+ new

@@ -1,12 +1,26 @@ +#************************************************************************************* +# Status take care of generating the html code that show the results position and the +# total results. +# +# Output Example +# +# 30 to 40 / 300 +#************************************************************************************* class NeatPages::Helpers::Status < NeatPages::Helpers::Builder + delegate :empty?, to: :pagination + delegate :offset, to: :pagination + delegate :out_of_bound?, to: :pagination + def generate return '' if empty? or out_of_bound? from, to = get_from_to_data return build_status from, to end + + private def build_status(from, to) reset_builder b '<span data-neat-pages-control="status" id="neat-pages-status">'