Class: Rafflesia::FoundryModelDescriptor

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/foundry/foundry_model_descriptor.rb

Constant Summary collapse

HASH_ATTRS =
{
  build: :build,
  deployment: :deployment,
  description: :description,
  endpoint: :endpoint,
  id: :id,
  input_types: :input_types,
  is_release_pinned: :is_release_pinned,
  license: :license,
  model_release: :model_release,
  name: :name,
  object: :object,
  offer: :offer,
  output_types: :output_types,
  price: :price,
  publisher: :publisher,
  release: :release,
  repository: :repository,
  scope: :scope,
  source_url: :source_url,
  workload: :workload
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ FoundryModelDescriptor

Returns a new instance of FoundryModelDescriptor.



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/rafflesia/foundry/foundry_model_descriptor.rb', line 53

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @build = hash[:build] ? Rafflesia::BuildRef.new(hash[:build]) : nil
  @deployment = hash[:deployment] ? Rafflesia::DeploymentRef.new(hash[:deployment]) : nil
  @description = hash[:description]
  @endpoint = hash[:endpoint] ? Rafflesia::FoundryModelEndpoint.new(hash[:endpoint]) : nil
  @id = hash[:id]
  @input_types = (hash[:input_types] || [])
  @is_release_pinned = hash[:is_release_pinned]
  @license = hash[:license]
  @model_release = hash[:model_release]
  @name = hash[:name]
  @object = hash[:object]
  @offer = hash[:offer] ? Rafflesia::DeploymentOffer.new(hash[:offer]) : nil
  @output_types = (hash[:output_types] || [])
  @price = hash[:price] ? Rafflesia::FoundryModelPrice.new(hash[:price]) : nil
  @publisher = hash[:publisher]
  @release = hash[:release] ? Rafflesia::ReleaseRef.new(hash[:release]) : nil
  @repository = hash[:repository] ? Rafflesia::RepositoryRef.new(hash[:repository]) : nil
  @scope = hash[:scope] ? Rafflesia::RegistryScope.new(hash[:scope]) : nil
  @source_url = hash[:source_url]
  @workload = hash[:workload]
end

Instance Attribute Details

#buildObject

Returns the value of attribute build.



31
32
33
# File 'lib/rafflesia/foundry/foundry_model_descriptor.rb', line 31

def build
  @build
end

#deploymentObject

Returns the value of attribute deployment.



31
32
33
# File 'lib/rafflesia/foundry/foundry_model_descriptor.rb', line 31

def deployment
  @deployment
end

#descriptionObject

Returns the value of attribute description.



31
32
33
# File 'lib/rafflesia/foundry/foundry_model_descriptor.rb', line 31

def description
  @description
end

#endpointObject

Returns the value of attribute endpoint.



31
32
33
# File 'lib/rafflesia/foundry/foundry_model_descriptor.rb', line 31

def endpoint
  @endpoint
end

#idObject

Returns the value of attribute id.



31
32
33
# File 'lib/rafflesia/foundry/foundry_model_descriptor.rb', line 31

def id
  @id
end

#input_typesObject

Returns the value of attribute input_types.



31
32
33
# File 'lib/rafflesia/foundry/foundry_model_descriptor.rb', line 31

def input_types
  @input_types
end

#is_release_pinnedObject

Returns the value of attribute is_release_pinned.



31
32
33
# File 'lib/rafflesia/foundry/foundry_model_descriptor.rb', line 31

def is_release_pinned
  @is_release_pinned
end

#licenseObject

Returns the value of attribute license.



31
32
33
# File 'lib/rafflesia/foundry/foundry_model_descriptor.rb', line 31

def license
  @license
end

#model_releaseObject

Returns the value of attribute model_release.



31
32
33
# File 'lib/rafflesia/foundry/foundry_model_descriptor.rb', line 31

def model_release
  @model_release
end

#nameObject

Returns the value of attribute name.



31
32
33
# File 'lib/rafflesia/foundry/foundry_model_descriptor.rb', line 31

def name
  @name
end

#objectObject

Returns the value of attribute object.



31
32
33
# File 'lib/rafflesia/foundry/foundry_model_descriptor.rb', line 31

def object
  @object
end

#offerObject

Returns the value of attribute offer.



31
32
33
# File 'lib/rafflesia/foundry/foundry_model_descriptor.rb', line 31

def offer
  @offer
end

#output_typesObject

Returns the value of attribute output_types.



31
32
33
# File 'lib/rafflesia/foundry/foundry_model_descriptor.rb', line 31

def output_types
  @output_types
end

#priceObject

Returns the value of attribute price.



31
32
33
# File 'lib/rafflesia/foundry/foundry_model_descriptor.rb', line 31

def price
  @price
end

#publisherObject

Returns the value of attribute publisher.



31
32
33
# File 'lib/rafflesia/foundry/foundry_model_descriptor.rb', line 31

def publisher
  @publisher
end

#releaseObject

Returns the value of attribute release.



31
32
33
# File 'lib/rafflesia/foundry/foundry_model_descriptor.rb', line 31

def release
  @release
end

#repositoryObject

Returns the value of attribute repository.



31
32
33
# File 'lib/rafflesia/foundry/foundry_model_descriptor.rb', line 31

def repository
  @repository
end

#scopeObject

Returns the value of attribute scope.



31
32
33
# File 'lib/rafflesia/foundry/foundry_model_descriptor.rb', line 31

def scope
  @scope
end

#source_urlObject

Returns the value of attribute source_url.



31
32
33
# File 'lib/rafflesia/foundry/foundry_model_descriptor.rb', line 31

def source_url
  @source_url
end

#workloadObject

Returns the value of attribute workload.



31
32
33
# File 'lib/rafflesia/foundry/foundry_model_descriptor.rb', line 31

def workload
  @workload
end