Class: Tinysky::LinkFacet

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

Instance Method Summary collapse

Constructor Details

#initialize(byte_start, byte_end, uri) ⇒ LinkFacet

Returns a new instance of LinkFacet.



3
4
5
6
7
# File 'lib/tinysky/link_facet.rb', line 3

def initialize(byte_start, byte_end, uri)
  @byte_start = byte_start
  @byte_end = byte_end
  @uri = uri
end

Instance Method Details

#to_hashObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/tinysky/link_facet.rb', line 9

def to_hash
  {
    "features" => [
      {
        "$type" => Tinysky::Lexicon::LINK_FACET,
        "uri" => @uri
      }
    ],
    "index" => {
      "byteEnd" => @byte_end,
      "byteStart" => @byte_start
    }
  }
end