Class: Jekyll_Tagger::PageInfo

Inherits:
Liquid::Drop
  • Object
show all
Defined in:
lib/jekyll_tagger/page_info.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pager, number, selected) ⇒ PageInfo

Returns a new instance of PageInfo.



5
6
7
8
9
10
# File 'lib/jekyll_tagger/page_info.rb', line 5

def initialize(pager,number,selected)
  @pager    = pager
  @number   = number
  @url      = @pager.url_maker.call(number)
  @selected = selected
end

Instance Attribute Details

#numberObject (readonly)

Returns the value of attribute number.



3
4
5
# File 'lib/jekyll_tagger/page_info.rb', line 3

def number
  @number
end

#selectedObject (readonly)

Returns the value of attribute selected.



3
4
5
# File 'lib/jekyll_tagger/page_info.rb', line 3

def selected
  @selected
end

#urlObject (readonly)

Returns the value of attribute url.



3
4
5
# File 'lib/jekyll_tagger/page_info.rb', line 3

def url
  @url
end

Instance Method Details

#liquid_method_missing(method) ⇒ Object



16
17
18
# File 'lib/jekyll_tagger/page_info.rb', line 16

def liquid_method_missing(method)
  method
end

#validObject



12
13
14
# File 'lib/jekyll_tagger/page_info.rb', line 12

def valid
  return @number >= 1 && @number <= @pager.page_count
end