Class: Mindee::V2::Parsing::Search::SearchModel
- Inherits:
-
Object
- Object
- Mindee::V2::Parsing::Search::SearchModel
- Defined in:
- lib/mindee/v2/parsing/search/search_model.rb
Overview
Individual model information.
Instance Attribute Summary collapse
-
#id ⇒ String
readonly
ID of the model.
-
#model_type ⇒ String
readonly
Type of the model.
-
#name ⇒ String
readonly
Name of the model.
-
#webhooks ⇒ Array<ModelWebhook>
readonly
List of webhooks associated with the model.
Instance Method Summary collapse
-
#initialize(payload) ⇒ SearchModel
constructor
A new instance of SearchModel.
-
#to_s ⇒ String
String representation of the model.
Constructor Details
#initialize(payload) ⇒ SearchModel
Returns a new instance of SearchModel.
24 25 26 27 28 29 |
# File 'lib/mindee/v2/parsing/search/search_model.rb', line 24 def initialize(payload) @id = payload['id'] @name = payload['name'] @model_type = payload['model_type'] @webhooks = (payload['webhooks'] || []).map { |w| ModelWebhook.new(w) } end |
Instance Attribute Details
#id ⇒ String (readonly)
Returns ID of the model.
12 13 14 |
# File 'lib/mindee/v2/parsing/search/search_model.rb', line 12 def id @id end |
#model_type ⇒ String (readonly)
Returns Type of the model.
18 19 20 |
# File 'lib/mindee/v2/parsing/search/search_model.rb', line 18 def model_type @model_type end |
#name ⇒ String (readonly)
Returns Name of the model.
15 16 17 |
# File 'lib/mindee/v2/parsing/search/search_model.rb', line 15 def name @name end |
#webhooks ⇒ Array<ModelWebhook> (readonly)
Returns List of webhooks associated with the model.
21 22 23 |
# File 'lib/mindee/v2/parsing/search/search_model.rb', line 21 def webhooks @webhooks end |
Instance Method Details
#to_s ⇒ String
String representation of the model.
33 34 35 36 37 38 39 40 |
# File 'lib/mindee/v2/parsing/search/search_model.rb', line 33 def to_s [ ":Name: #{@name}", ":ID: #{@id}", ":Model Type: #{@model_type}", ":Webhooks: #{@webhooks.join("\n")}", ].join("\n") end |