Class: AtlassianAppVersions::AppVersion

Inherits:
AbstractVersion show all
Defined in:
lib/atlassian_app_versions.rb

Direct Known Subclasses

ArchivedAppVersion, LatestAppVersion

Instance Attribute Summary

Attributes inherited from AbstractVersion

#version

Instance Method Summary collapse

Methods inherited from AbstractVersion

#<=>, #initialize, #inspect, #releaseDate, #to_s, #versionJSON

Constructor Details

This class inherits a constructor from AtlassianAppVersions::AbstractVersion

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



364
365
366
367
368
369
370
# File 'lib/atlassian_app_versions.rb', line 364

def method_missing(name, *args, &block)
    if releaseJSON and releaseJSON.keys.member? name.to_s then
	releaseJSON[name.to_s]
    else
	super
    end
end

Instance Method Details

#keysObject



359
360
361
362
# File 'lib/atlassian_app_versions.rb', line 359

def keys
    # Combine versionJSON keys with releaseJSON keys. Note that Confluence 5.6 and earlier doesn't have releaseJSON.
    releaseJSON ? releaseJSON.keys + super : super
end

#releaseJSONObject



348
349
350
# File 'lib/atlassian_app_versions.rb', line 348

def releaseJSON
    raise "Override me"
end

#relNotesObject



352
353
354
355
356
357
# File 'lib/atlassian_app_versions.rb', line 352

def relNotes
    # RC releases don't have release notes, in which case return nil
    if releaseJSON
	    releaseJSON["releaseNotes"]&.strip
    end
end

#respond_to_missing?(name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


372
373
374
# File 'lib/atlassian_app_versions.rb', line 372

def respond_to_missing?(name, include_private = false)
    keys.member? name.to_s || super
end