Class: Kagi::API::Models::Content::Search
- Inherits:
-
Data
- Object
- Data
- Kagi::API::Models::Content::Search
- Defined in:
- lib/kagi/api/models/content/search.rb
Overview
Models search data.
Instance Attribute Summary collapse
-
#published_at ⇒ Object
readonly
Returns the value of attribute published_at.
-
#rank ⇒ Object
readonly
Returns the value of attribute rank.
-
#snippet ⇒ Object
readonly
Returns the value of attribute snippet.
-
#thumbnail ⇒ Object
readonly
Returns the value of attribute thumbnail.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(rank: nil, title: nil, url: nil, snippet: nil, published_at: nil, thumbnail: nil, **attributes) ⇒ Search
constructor
rubocop:todo Metrics/ParameterLists.
Constructor Details
#initialize(rank: nil, title: nil, url: nil, snippet: nil, published_at: nil, thumbnail: nil, **attributes) ⇒ Search
rubocop:todo Metrics/ParameterLists
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/kagi/api/models/content/search.rb', line 19 def initialize( rank: nil, title: nil, url: nil, snippet: nil, published_at: nil, thumbnail: nil, **attributes ) super end |
Instance Attribute Details
#published_at ⇒ Object (readonly)
Returns the value of attribute published_at
10 11 12 |
# File 'lib/kagi/api/models/content/search.rb', line 10 def published_at @published_at end |
#rank ⇒ Object (readonly)
Returns the value of attribute rank
10 11 12 |
# File 'lib/kagi/api/models/content/search.rb', line 10 def rank @rank end |
#snippet ⇒ Object (readonly)
Returns the value of attribute snippet
10 11 12 |
# File 'lib/kagi/api/models/content/search.rb', line 10 def snippet @snippet end |
#thumbnail ⇒ Object (readonly)
Returns the value of attribute thumbnail
10 11 12 |
# File 'lib/kagi/api/models/content/search.rb', line 10 def thumbnail @thumbnail end |
#title ⇒ Object (readonly)
Returns the value of attribute title
10 11 12 |
# File 'lib/kagi/api/models/content/search.rb', line 10 def title @title end |
#type ⇒ Object (readonly)
Returns the value of attribute type
10 11 12 |
# File 'lib/kagi/api/models/content/search.rb', line 10 def type @type end |
#url ⇒ Object (readonly)
Returns the value of attribute url
10 11 12 |
# File 'lib/kagi/api/models/content/search.rb', line 10 def url @url end |
Class Method Details
.for(key_map: SEARCH_MAP, **attributes) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/kagi/api/models/content/search.rb', line 11 def self.for(key_map: SEARCH_MAP, **attributes) new( **attributes.transform_keys(key_map), thumbnail: (Thumbnail[**attributes[:thumbnail]] if attributes.key? :thumbnail) ) end |