Module: VersionedRoutes::RouteVersionInfo
- Defined in:
- lib/versioned_routes/route_version_info.rb
Instance Attribute Summary collapse
-
#current_version_number ⇒ Object
Returns the value of attribute current_version_number.
Instance Method Summary collapse
- #add_route(mapping, name) ⇒ Object
- #clear! ⇒ Object
- #current_version ⇒ Object
- #version_info ⇒ Object
Instance Attribute Details
#current_version_number ⇒ Object
Returns the value of attribute current_version_number.
7 8 9 |
# File 'lib/versioned_routes/route_version_info.rb', line 7 def current_version_number @current_version_number end |
Instance Method Details
#add_route(mapping, name) ⇒ Object
14 15 16 17 |
# File 'lib/versioned_routes/route_version_info.rb', line 14 def add_route(mapping, name) return unless current_version.append mapping super end |
#clear! ⇒ Object
9 10 11 12 |
# File 'lib/versioned_routes/route_version_info.rb', line 9 def clear! reset_version_info! super end |
#current_version ⇒ Object
19 20 21 |
# File 'lib/versioned_routes/route_version_info.rb', line 19 def current_version version_info[current_version_number || 1] end |
#version_info ⇒ Object
23 24 25 |
# File 'lib/versioned_routes/route_version_info.rb', line 23 def version_info @version_info || reset_version_info! end |