Module: VersionCake::ControllerAdditions

Extended by:
ActiveSupport::Concern
Defined in:
lib/versioncake/controller_additions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#versioned_request=(value) ⇒ Object

Sets the attribute versioned_request

Parameters:

  • value

    the value to set the attribute versioned_request to.



7
8
9
# File 'lib/versioncake/controller_additions.rb', line 7

def versioned_request=(value)
  @versioned_request = value
end

Instance Method Details

#derived_versionObject

The requested version by a client or if it’s nil the latest or default version configured.



23
24
25
# File 'lib/versioncake/controller_additions.rb', line 23

def derived_version
  versioned_request.version
end

#is_latest_versionObject

A boolean check to determine if the latest version is requested.



28
29
30
# File 'lib/versioncake/controller_additions.rb', line 28

def is_latest_version
  versioned_request.is_latest_version?
end

#requested_versionObject

The explicit version requested by a client, this may not be the rendered version and may also be nil.



17
18
19
# File 'lib/versioncake/controller_additions.rb', line 17

def requested_version
  versioned_request.extracted_version
end