Module: VersionedRoutes::RouteVersionInfo

Defined in:
lib/versioned_routes/route_version_info.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#current_version_numberObject

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_versionObject



19
20
21
# File 'lib/versioned_routes/route_version_info.rb', line 19

def current_version
  version_info[current_version_number || 1]
end

#version_infoObject



23
24
25
# File 'lib/versioned_routes/route_version_info.rb', line 23

def version_info
  @version_info || reset_version_info!
end