Class: MistralModels::Model

Inherits:
Object
  • Object
show all
Defined in:
lib/mistral_rb/response_models.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model_hash) ⇒ Model

Returns a new instance of Model.



67
68
69
70
71
72
73
# File 'lib/mistral_rb/response_models.rb', line 67

def initialize(model_hash)
  @id = model_hash["id"]
  @object = model_hash["object"]
  @created = model_hash["created"]
  @owned_by = model_hash["owned_by"]
  @permissions = model_hash["permission"] # This could be further parsed into Permission objects if detailed parsing is required
end

Instance Attribute Details

#createdObject (readonly)

Returns the value of attribute created.



65
66
67
# File 'lib/mistral_rb/response_models.rb', line 65

def created
  @created
end

#idObject (readonly)

Returns the value of attribute id.



65
66
67
# File 'lib/mistral_rb/response_models.rb', line 65

def id
  @id
end

#objectObject (readonly)

Returns the value of attribute object.



65
66
67
# File 'lib/mistral_rb/response_models.rb', line 65

def object
  @object
end

#owned_byObject (readonly)

Returns the value of attribute owned_by.



65
66
67
# File 'lib/mistral_rb/response_models.rb', line 65

def owned_by
  @owned_by
end

#permissionsObject (readonly)

Returns the value of attribute permissions.



65
66
67
# File 'lib/mistral_rb/response_models.rb', line 65

def permissions
  @permissions
end