Class: Archaeo::SearchResult

Inherits:
Struct
  • Object
show all
Defined in:
lib/archaeo/archive_search.rb

Overview

Value object for a single search match within an archived snapshot.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#contextObject

Returns the value of attribute context

Returns:

  • (Object)

    the current value of context



5
6
7
# File 'lib/archaeo/archive_search.rb', line 5

def context
  @context
end

#match_offsetObject

Returns the value of attribute match_offset

Returns:

  • (Object)

    the current value of match_offset



5
6
7
# File 'lib/archaeo/archive_search.rb', line 5

def match_offset
  @match_offset
end

#snapshotObject

Returns the value of attribute snapshot

Returns:

  • (Object)

    the current value of snapshot



5
6
7
# File 'lib/archaeo/archive_search.rb', line 5

def snapshot
  @snapshot
end

#urlObject

Returns the value of attribute url

Returns:

  • (Object)

    the current value of url



5
6
7
# File 'lib/archaeo/archive_search.rb', line 5

def url
  @url
end

Instance Method Details

#as_jsonObject



18
19
20
# File 'lib/archaeo/archive_search.rb', line 18

def as_json(*)
  to_h
end

#to_hObject



9
10
11
12
13
14
15
16
# File 'lib/archaeo/archive_search.rb', line 9

def to_h
  {
    url: url,
    snapshot: snapshot.as_json,
    context: context,
    match_offset: match_offset,
  }
end