Class: Mindee::V2::Parsing::Search::SearchModel

Inherits:
Object
  • Object
show all
Defined in:
lib/mindee/v2/parsing/search/search_model.rb

Overview

Individual model information.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ SearchModel

Returns a new instance of SearchModel.

Parameters:

  • payload (Hash)

    The parsed JSON payload mapping to the search model.



19
20
21
22
23
# File 'lib/mindee/v2/parsing/search/search_model.rb', line 19

def initialize(payload)
  @id = payload['id']
  @name = payload['name']
  @model_type = payload['model_type']
end

Instance Attribute Details

#idString (readonly)

Returns ID of the model.

Returns:

  • (String)

    ID of the model.



10
11
12
# File 'lib/mindee/v2/parsing/search/search_model.rb', line 10

def id
  @id
end

#model_typeString (readonly)

Returns Type of the model.

Returns:

  • (String)

    Type of the model.



16
17
18
# File 'lib/mindee/v2/parsing/search/search_model.rb', line 16

def model_type
  @model_type
end

#nameString (readonly)

Returns Name of the model.

Returns:

  • (String)

    Name of the model.



13
14
15
# File 'lib/mindee/v2/parsing/search/search_model.rb', line 13

def name
  @name
end

Instance Method Details

#to_sString

String representation of the model.

Returns:

  • (String)


27
28
29
30
31
32
33
# File 'lib/mindee/v2/parsing/search/search_model.rb', line 27

def to_s
  [
    ":Name: #{@name}",
    ":ID: #{@id}",
    ":Model Type: #{@model_type}",
  ].join("\n")
end