Class: Loaf::Crumb Private
- Inherits:
-
Object
- Object
- Loaf::Crumb
- 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
- #match ⇒ Object readonly private
- #name ⇒ Object readonly private
- #url ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(name, url, options = {}) ⇒ Crumb
constructor
private
A new instance of Crumb.
- #raise_name_error ⇒ Object private
- #raise_url_error ⇒ Object private
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, = {}) @name = name || raise_name_error @url = url || raise_url_error @match = .fetch(:match, Loaf.configuration.match) freeze end |
Instance Attribute Details
#match ⇒ Object (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 |
#name ⇒ Object (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 |
#url ⇒ Object (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_error ⇒ Object
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.
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_error ⇒ Object
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.
24 25 26 |
# File 'lib/loaf/crumb.rb', line 24 def raise_url_error raise ArgumentError, 'breadcrumb second argument, `url`, cannot be nil' end |