Class: Bridgetown::Paginate::Generator::PageTrail

Inherits:
Object
  • Object
show all
Defined in:
lib/bridgetown-paginate/paginator.rb

Overview

Small utility class that handles individual pagination trails and makes them easier to work with in Liquid

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(num, path, title) ⇒ PageTrail

Returns a new instance of PageTrail.



123
124
125
126
127
# File 'lib/bridgetown-paginate/paginator.rb', line 123

def initialize(num, path, title)
  @num = num
  @path = path
  @title = title
end

Instance Attribute Details

#numObject (readonly)

Returns the value of attribute num.



121
122
123
# File 'lib/bridgetown-paginate/paginator.rb', line 121

def num
  @num
end

#pathObject (readonly)

Returns the value of attribute path.



121
122
123
# File 'lib/bridgetown-paginate/paginator.rb', line 121

def path
  @path
end

#titleObject (readonly)

Returns the value of attribute title.



121
122
123
# File 'lib/bridgetown-paginate/paginator.rb', line 121

def title
  @title
end

Instance Method Details

#to_liquidObject



129
130
131
132
133
134
135
# File 'lib/bridgetown-paginate/paginator.rb', line 129

def to_liquid
  {
    "num"   => num,
    "path"  => path,
    "title" => title,
  }
end