Class: Loaf::Crumb Private

Inherits:
Object
  • Object
show all
Defined in:
lib/loaf/crumb.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Basic crumb container for internal use

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, url, options = {}) ⇒ Crumb

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Crumb.



13
14
15
16
17
18
# File 'lib/loaf/crumb.rb', line 13

def initialize(name, url, options = {})
  @name  = name || raise_name_error
  @url   = url || raise_url_error
  @match = options.fetch(:match, Loaf.configuration.match)
  freeze
end

Instance Attribute Details

#matchObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



11
12
13
# File 'lib/loaf/crumb.rb', line 11

def match
  @match
end

#nameObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



7
8
9
# File 'lib/loaf/crumb.rb', line 7

def name
  @name
end

#urlObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



9
10
11
# File 'lib/loaf/crumb.rb', line 9

def url
  @url
end

Instance Method Details

#raise_name_errorObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Raises:

  • (ArgumentError)


20
21
22
# File 'lib/loaf/crumb.rb', line 20

def raise_name_error
  raise ArgumentError, 'breadcrumb first argument, `name`, cannot be nil'
end

#raise_url_errorObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Raises:

  • (ArgumentError)


24
25
26
# File 'lib/loaf/crumb.rb', line 24

def raise_url_error
  raise ArgumentError, 'breadcrumb second argument, `url`, cannot be nil'
end