Class: API::Helpers::Version
Instance Method Summary
collapse
#expose_path, #expose_url, #issues_available?, #mrs_available?, #project_feature_string_access_level
Constructor Details
#initialize(version) ⇒ Version
Returns a new instance of Version.
8
9
10
11
12
13
14
|
# File 'lib/api/helpers/version.rb', line 8
def initialize(version)
@version = version.to_s
unless API.versions.include?(version)
raise ArgumentError, 'Unknown API version!'
end
end
|
Instance Method Details
#root_path ⇒ Object
16
17
18
|
# File 'lib/api/helpers/version.rb', line 16
def root_path
File.join('/', API.prefix.to_s, @version)
end
|
#root_url ⇒ Object
20
21
22
|
# File 'lib/api/helpers/version.rb', line 20
def root_url
@root_url ||= expose_url(root_path)
end
|
#to_s ⇒ Object
24
25
26
|
# File 'lib/api/helpers/version.rb', line 24
def to_s
@version
end
|