Module: Sevgi::Graphics::Mixtures::RDF::InstanceMethods

Defined in:
lib/sevgi/graphics/mixtures/rdf.rb

Instance Method Summary collapse

Instance Method Details

#License(**kwargs, &block) ⇒ Object



8
# File 'lib/sevgi/graphics/mixtures/rdf.rb', line 8

def License(**kwargs, &block)             =  { RDFWork(**kwargs, &block) }

#License_CC0(**kwargs, &block) ⇒ Object



23
# File 'lib/sevgi/graphics/mixtures/rdf.rb', line 23

def License_CC0(**kwargs, &block)         = License(**kwargs, license: "https://creativecommons.org/publicdomain/zero/1.0/", &block)

#License_CC_BY_NC(**kwargs, &block) ⇒ Object



15
# 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)

#License_CC_BY_NC_ND(**kwargs, &block) ⇒ Object



21
# File 'lib/sevgi/graphics/mixtures/rdf.rb', line 21

def License_CC_BY_NC_ND(**kwargs, &block) = License(**kwargs, license: "https://creativecommons.org/licenses/by-nc-nd/4.0/", &block)

#License_CC_BY_NC_SA(**kwargs, &block) ⇒ Object



17
# File 'lib/sevgi/graphics/mixtures/rdf.rb', line 17

def License_CC_BY_NC_SA(**kwargs, &block) = License(**kwargs, license: "https://creativecommons.org/licenses/by-nc-sa/4.0/", &block)

#License_CC_BY_ND(**kwargs, &block) ⇒ Object



19
# File 'lib/sevgi/graphics/mixtures/rdf.rb', line 19

def License_CC_BY_ND(**kwargs, &block)    = License(**kwargs, license: "https://creativecommons.org/licenses/by-nd/4.0/", &block)

#License_CC_BY_SA(**kwargs, &block) ⇒ Object

Use SPDX license codes in underscored form: spdx.org/licenses/

rubocop:disable Metrics/LineLength



13
# File 'lib/sevgi/graphics/mixtures/rdf.rb', line 13

def License_CC_BY_SA(**kwargs, &block)    = License(**kwargs, license: "https://creativecommons.org/licenses/by-sa/4.0/", &block)

#License_LAL(**kwargs, &block) ⇒ Object



25
26
# File 'lib/sevgi/graphics/mixtures/rdf.rb', line 25

def License_LAL(**kwargs, &block)         = License(**kwargs, license: "https://artlibre.org/licence/lal/en/", &block)
# rubocop:enable Metrics/LineLength

#RDF(**kwargs, &block) ⇒ Object

rubocop:enable Metrics/LineLength

Raises:



28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/sevgi/graphics/mixtures/rdf.rb', line 28

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



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/sevgi/graphics/mixtures/rdf.rb', line 41

def RDFWork(**kwargs, &block) # rubocop:disable Metrics/MethodLength
  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