Class: Calagator::MachineTag
- Inherits:
-
Struct
- Object
- Struct
- Calagator::MachineTag
- Defined in:
- lib/calagator/machine_tag.rb
Defined Under Namespace
Modules: TagExtensions
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name
21 22 23 |
# File 'lib/calagator/machine_tag.rb', line 21 def name @name end |
Class Method Details
.configure {|_self| ... } ⇒ Object
28 29 30 |
# File 'lib/calagator/machine_tag.rb', line 28 def self.configure yield self end |
Instance Method Details
#namespace ⇒ Object
41 42 43 |
# File 'lib/calagator/machine_tag.rb', line 41 def namespace matches[:namespace] end |
#predicate ⇒ Object
45 46 47 |
# File 'lib/calagator/machine_tag.rb', line 45 def predicate matches[:predicate] end |
#url ⇒ Object
53 54 55 56 57 58 59 |
# File 'lib/calagator/machine_tag.rb', line 53 def url return unless machine_tag = urls[namespace] return unless url_template = machine_tag[predicate] url = sprintf(url_template, value) url = "#{site_root_url}defunct?url=https://web.archive.org/web/#{archive_date}/#{url}" if defunct? url end |
#value ⇒ Object
49 50 51 |
# File 'lib/calagator/machine_tag.rb', line 49 def value matches[:value] end |
#venue? ⇒ Boolean
37 38 39 |
# File 'lib/calagator/machine_tag.rb', line 37 def venue? venue_predicates.include? predicate end |