Class: QueryService::WikidataItem

Inherits:
Object
  • Object
show all
Defined in:
lib/query_service.rb

Overview

different views of a Wikidata item

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ WikidataItem

Returns a new instance of WikidataItem.



36
37
38
# File 'lib/query_service.rb', line 36

def initialize(url)
  @url = url
end

Instance Method Details

#idObject



40
41
42
# File 'lib/query_service.rb', line 40

def id
  url.split('/').last unless url.to_s.empty?
end


44
45
46
# File 'lib/query_service.rb', line 44

def qlink
  "{{Q|#{id}}}" if id
end