Class: Kagi::API::Models::Search

Inherits:
Data
  • Object
show all
Defined in:
lib/kagi/api/models/search.rb

Overview

Models the search payload.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data

Returns:

  • (Object)

    the current value of data



7
8
9
# File 'lib/kagi/api/models/search.rb', line 7

def data
  @data
end

#metaObject (readonly)

Returns the value of attribute meta

Returns:

  • (Object)

    the current value of meta



7
8
9
# File 'lib/kagi/api/models/search.rb', line 7

def meta
  @meta
end

Class Method Details

.for(**attributes) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/kagi/api/models/search.rb', line 8

def self.for(**attributes)
  new(
    **attributes.merge!(
      meta: Content::Meta.for(**attributes[:meta]),
      data: attributes[:data].map { Content::Search.for(**it) }
    )
  )
end