module STAC::Extension

Extension modules must extend this module.

Public Instance Methods

identifier(identifier = nil) click to toggle source

Returns extension id for ‘stac_extensions` field.

When given an argument, sets the given value as its identifier.

# File lib/stac/extension.rb, line 14
def identifier(identifier = nil)
  # @type self: Module
  if identifier.nil?
    @identifier or raise ExtensionWithoutIdentifierError, "extension module must be set identifier: #{name}"
  else
    @identifier = identifier
  end
end
scope(*scope) click to toggle source

Returns extendable STAC Object classes.

When given arguments, sets the given values as its scope.

# File lib/stac/extension.rb, line 26
def scope(*scope)
  if scope.empty?
    @scope ||= []
  else
    @scope = scope
  end
end