Class: Toys::SourceSpec::Base

Inherits:
Object
  • Object
show all
Defined in:
core-docs/toys/source_spec.rb

Overview

The base class of a source spec, holding the attributes common to every kind, and implementing equality.

Do not instantiate this class directly. Use one of the factory methods such as path.

Defined in the toys-core gem

Direct Known Subclasses

Block, Gem, Git, Path

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#context_directory ⇒ String? (readonly)

The context directory for tools loaded from this source, or nil if the source does not dictate a context directory.

Returns:

  • (String, nil)


166
167
168
# File 'core-docs/toys/source_spec.rb', line 166

def context_directory
  @context_directory
end

#source_name ⇒ String? (readonly)

The user-visible name for tools loaded from this source, or nil to generate a default at resolution time.

Returns:

  • (String, nil)


174
175
176
# File 'core-docs/toys/source_spec.rb', line 174

def source_name
  @source_name
end

Instance Method Details

#==(other) ⇒ boolean Also known as: eql?

Source specs compare by value. Specs of different kinds are never equal, even if their common attributes match.

Parameters:

  • other (Object)

Returns:

  • (boolean)


183
184
185
# File 'core-docs/toys/source_spec.rb', line 183

def ==(other)
  # Source available in the toys-core gem
end

#hash ⇒ Integer

Returns:

  • (Integer)


191
192
193
# File 'core-docs/toys/source_spec.rb', line 191

def hash
  # Source available in the toys-core gem
end