Module: Sevgi::Graphics::Mixtures::RDF
- Defined in:
- lib/sevgi/graphics/mixtures/rdf.rb
Instance Method Summary collapse
- #License(**kwargs, &block) ⇒ Object
- #License_CC0(**kwargs, &block) ⇒ Object
- #License_CC_BY_NC(**kwargs, &block) ⇒ Object
- #License_CC_BY_NC_ND(**kwargs, &block) ⇒ Object
- #License_CC_BY_NC_SA(**kwargs, &block) ⇒ Object
- #License_CC_BY_ND(**kwargs, &block) ⇒ Object
-
#License_CC_BY_SA(**kwargs, &block) ⇒ Object
Use SPDX license codes in underscored form: https://spdx.org/licenses/.
- #License_LAL(**kwargs, &block) ⇒ Object
- #RDF(**_kwargs, &block) ⇒ Object
-
#RDFWork(**kwargs, &block) ⇒ Object
rubocop:disable Metrics/MethodLength.
Instance Method Details
#License(**kwargs, &block) ⇒ Object
7 |
# File 'lib/sevgi/graphics/mixtures/rdf.rb', line 7 def License(**kwargs, &block) = { RDFWork(**kwargs, &block) } |
#License_CC0(**kwargs, &block) ⇒ Object
31 32 33 |
# File 'lib/sevgi/graphics/mixtures/rdf.rb', line 31 def License_CC0(**kwargs, &block) License(**kwargs, license: "https://creativecommons.org/publicdomain/zero/1.0/", &block) end |
#License_CC_BY_NC(**kwargs, &block) ⇒ Object
15 16 17 |
# File 'lib/sevgi/graphics/mixtures/rdf.rb', line 15 def License_CC_BY_NC(**kwargs, &block) License(**kwargs, license: "https://creativecommons.org/licenses/by-nc/4.0/", &block) end |
#License_CC_BY_NC_ND(**kwargs, &block) ⇒ Object
27 28 29 |
# File 'lib/sevgi/graphics/mixtures/rdf.rb', line 27 def License_CC_BY_NC_ND(**kwargs, &block) License(**kwargs, license: "https://creativecommons.org/licenses/by-nc-nd/4.0/", &block) end |
#License_CC_BY_NC_SA(**kwargs, &block) ⇒ Object
19 20 21 |
# File 'lib/sevgi/graphics/mixtures/rdf.rb', line 19 def License_CC_BY_NC_SA(**kwargs, &block) License(**kwargs, license: "https://creativecommons.org/licenses/by-nc-sa/4.0/", &block) end |
#License_CC_BY_ND(**kwargs, &block) ⇒ Object
23 24 25 |
# File 'lib/sevgi/graphics/mixtures/rdf.rb', line 23 def License_CC_BY_ND(**kwargs, &block) License(**kwargs, license: "https://creativecommons.org/licenses/by-nd/4.0/", &block) end |
#License_CC_BY_SA(**kwargs, &block) ⇒ Object
Use SPDX license codes in underscored form: https://spdx.org/licenses/
11 12 13 |
# File 'lib/sevgi/graphics/mixtures/rdf.rb', line 11 def License_CC_BY_SA(**kwargs, &block) License(**kwargs, license: "https://creativecommons.org/licenses/by-sa/4.0/", &block) end |
#License_LAL(**kwargs, &block) ⇒ Object
35 |
# File 'lib/sevgi/graphics/mixtures/rdf.rb', line 35 def License_LAL(**kwargs, &block) = License(**kwargs, license: "https://artlibre.org/licence/lal/en/", &block) |
#RDF(**_kwargs, &block) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/sevgi/graphics/mixtures/rdf.rb', line 37 def RDF(**_kwargs, &block) raise ArgumentError, "Block required" unless block Element( :"rdf:RDF", "xmlns:rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "xmlns:dc": "http://purl.org/dc/elements/1.1/", "xmlns:cc": "http://creativecommons.org/ns#" ) do Within(&block) end end |
#RDFWork(**kwargs, &block) ⇒ Object
rubocop:disable Metrics/MethodLength
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/sevgi/graphics/mixtures/rdf.rb', line 51 def RDFWork(**kwargs, &block) RDF do Element(:"cc:Work", "rdf:about": "") do Element(:"dc:format", "image/svg+xml") Element(:"dc:type", "rdf:resource": "http://purl.org/dc/dcmitype/StillImage") Element(:"dc:title", kwargs[:title]) if kwargs[:title] Element(:"dc:description", kwargs[:description]) if kwargs[:description] Element(:"dc:creator", kwargs[:creator]) if kwargs[:creator] Element(:"dc:publisher", kwargs[:publisher]) if kwargs[:publisher] Element(:"dc:date", kwargs[:date]) if kwargs[:date] Element(:"dc:language", kwargs[:language]) if kwargs[:language] Element(:"cc:license", "rdf:resource": kwargs[:license]) if kwargs[:license] Within(&block) if block end end end |