Class: CollectionSpace::ApiVersion

Inherits:
Struct
  • Object
show all
Defined in:
lib/collectionspace/client/api_version.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#buildObject

Returns the value of attribute build

Returns:

  • (Object)

    the current value of build



4
5
6
# File 'lib/collectionspace/client/api_version.rb', line 4

def build
  @build
end

#majorObject

Returns the value of attribute major

Returns:

  • (Object)

    the current value of major



4
5
6
# File 'lib/collectionspace/client/api_version.rb', line 4

def major
  @major
end

#messageObject

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



4
5
6
# File 'lib/collectionspace/client/api_version.rb', line 4

def message
  @message
end

#minorObject

Returns the value of attribute minor

Returns:

  • (Object)

    the current value of minor



4
5
6
# File 'lib/collectionspace/client/api_version.rb', line 4

def minor
  @minor
end

#patchObject

Returns the value of attribute patch

Returns:

  • (Object)

    the current value of patch



4
5
6
# File 'lib/collectionspace/client/api_version.rb', line 4

def patch
  @patch
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



4
5
6
# File 'lib/collectionspace/client/api_version.rb', line 4

def status
  @status
end

Instance Method Details

#failure?Boolean

Returns:

  • (Boolean)


8
# File 'lib/collectionspace/client/api_version.rb', line 8

def failure? = !success?

#joinedObject



10
11
12
13
14
# File 'lib/collectionspace/client/api_version.rb', line 10

def joined
  return if failure?

  [major, minor].compact.join(".")
end

#success?Boolean

Returns:

  • (Boolean)


6
# File 'lib/collectionspace/client/api_version.rb', line 6

def success? = status == :success