Class: Wikidatum::Reference
- Inherits:
-
Object
- Object
- Wikidatum::Reference
- Defined in:
- lib/wikidatum/reference.rb
Instance Attribute Summary collapse
-
#hash ⇒ String
readonly
Hash of the reference (a cryptographic hash, not a Ruby hash).
- #parts ⇒ Array<Wikidatum::ReferencePart> readonly
Instance Method Summary collapse
Instance Attribute Details
#hash ⇒ String (readonly)
Returns Hash of the reference (a cryptographic hash, not a Ruby hash).
5 6 7 |
# File 'lib/wikidatum/reference.rb', line 5 def hash @hash end |
#parts ⇒ Array<Wikidatum::ReferencePart> (readonly)
8 9 10 |
# File 'lib/wikidatum/reference.rb', line 8 def parts @parts end |
Instance Method Details
#inspect ⇒ String
27 28 29 |
# File 'lib/wikidatum/reference.rb', line 27 def inspect "<Wikidatum::Reference hash=#{@hash.inspect} parts=#{@parts.inspect}>" end |
#to_h ⇒ Hash
19 20 21 22 23 24 |
# File 'lib/wikidatum/reference.rb', line 19 def to_h { hash: @hash, parts: @parts.map(&:to_h) } end |