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
22 23 24 |
# File 'lib/calagator/machine_tag.rb', line 22 def name @name end |
Class Method Details
.configure {|_self| ... } ⇒ Object
29 30 31 |
# File 'lib/calagator/machine_tag.rb', line 29 def self.configure yield self end |
Instance Method Details
#namespace ⇒ Object
42 43 44 |
# File 'lib/calagator/machine_tag.rb', line 42 def namespace matches[:namespace] end |
#predicate ⇒ Object
46 47 48 |
# File 'lib/calagator/machine_tag.rb', line 46 def predicate matches[:predicate] end |
#url ⇒ Object
54 55 56 57 58 59 60 61 62 63 |
# File 'lib/calagator/machine_tag.rb', line 54 def url return unless machine_tag = urls[namespace] return unless url_template = machine_tag[predicate] url = format(url_template, value) if defunct? url = "#{site_root_url}defunct?url=https://web.archive.org/web/#{archive_date}/#{url}" end url end |
#value ⇒ Object
50 51 52 |
# File 'lib/calagator/machine_tag.rb', line 50 def value matches[:value] end |
#venue? ⇒ Boolean
38 39 40 |
# File 'lib/calagator/machine_tag.rb', line 38 def venue? venue_predicates.include? predicate end |