Module: Stannum

Defined in:
lib/stannum.rb,
lib/stannum/rspec.rb,
lib/stannum/entity.rb,
lib/stannum/errors.rb,
lib/stannum/schema.rb,
lib/stannum/struct.rb,
lib/stannum/support.rb,
lib/stannum/version.rb,
lib/stannum/contract.rb,
lib/stannum/entities.rb,
lib/stannum/messages.rb,
lib/stannum/attribute.rb,
lib/stannum/contracts.rb,
lib/stannum/constraint.rb,
lib/stannum/constraints.rb,
lib/stannum/parameter_validation.rb

Overview

A library for specifying and validating data structures.

Defined Under Namespace

Modules: Constraints, Contracts, Entities, Entity, Messages, ParameterValidation, RSpec, Struct, Support, Version Classes: Attribute, Constraint, Contract, Errors, Schema

Constant Summary collapse

VERSION =

The current version of the gem in Rubygems format.

Version.to_gem_version

Class Method Summary collapse

Class Method Details

.gem_pathString

Returns the absolute path to the gem directory.

Returns:

  • (String)

    the absolute path to the gem directory.



20
21
22
23
24
# File 'lib/stannum.rb', line 20

def self.gem_path
  pattern = /#{File::SEPARATOR}lib#{File::SEPARATOR}?\z/

  __dir__.sub(pattern, '')
end

.versionString

Returns the current version of the gem.

Returns:

  • (String)

    the current version of the gem.



27
28
29
# File 'lib/stannum.rb', line 27

def self.version
  @version ||= Stannum::Version.to_gem_version
end