Class: Rafflesia::RepositoryData
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::RepositoryData
- Defined in:
- lib/rafflesia/registry/repository_data.rb
Constant Summary collapse
- HASH_ATTRS =
{ builds: :builds, deployments: :deployments, lineage: :lineage, object: :object, offers: :offers, releases: :releases, revision_pointers: :revision_pointers, revisions: :revisions, summary: :summary }.freeze
Instance Attribute Summary collapse
-
#builds ⇒ Object
Returns the value of attribute builds.
-
#deployments ⇒ Object
Returns the value of attribute deployments.
-
#lineage ⇒ Object
Returns the value of attribute lineage.
-
#object ⇒ Object
Returns the value of attribute object.
-
#offers ⇒ Object
Returns the value of attribute offers.
-
#releases ⇒ Object
Returns the value of attribute releases.
-
#revision_pointers ⇒ Object
Returns the value of attribute revision_pointers.
-
#revisions ⇒ Object
Returns the value of attribute revisions.
-
#summary ⇒ Object
Returns the value of attribute summary.
Instance Method Summary collapse
-
#initialize(json) ⇒ RepositoryData
constructor
A new instance of RepositoryData.
Constructor Details
#initialize(json) ⇒ RepositoryData
Returns a new instance of RepositoryData.
31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/rafflesia/registry/repository_data.rb', line 31 def initialize(json) super() hash = self.class.normalize(json) @builds = (hash[:builds] || []).map { |item| item ? Rafflesia::BuildRef.new(item) : nil } @deployments = (hash[:deployments] || []).map { |item| item ? Rafflesia::DeploymentRef.new(item) : nil } @lineage = (hash[:lineage] || []).map { |item| item ? Rafflesia::LineageEdge.new(item) : nil } @object = hash[:object] @offers = (hash[:offers] || []).map { |item| item ? Rafflesia::DeploymentOffer.new(item) : nil } @releases = (hash[:releases] || []).map { |item| item ? Rafflesia::ReleaseRef.new(item) : nil } @revision_pointers = (hash[:revision_pointers] || []).map { |item| item ? Rafflesia::RevisionPointer.new(item) : nil } @revisions = (hash[:revisions] || []).map { |item| item ? Rafflesia::RevisionRef.new(item) : nil } @summary = hash[:summary] ? Rafflesia::RepositorySummary.new(hash[:summary]) : nil end |
Instance Attribute Details
#builds ⇒ Object
Returns the value of attribute builds.
20 21 22 |
# File 'lib/rafflesia/registry/repository_data.rb', line 20 def builds @builds end |
#deployments ⇒ Object
Returns the value of attribute deployments.
20 21 22 |
# File 'lib/rafflesia/registry/repository_data.rb', line 20 def deployments @deployments end |
#lineage ⇒ Object
Returns the value of attribute lineage.
20 21 22 |
# File 'lib/rafflesia/registry/repository_data.rb', line 20 def lineage @lineage end |
#object ⇒ Object
Returns the value of attribute object.
20 21 22 |
# File 'lib/rafflesia/registry/repository_data.rb', line 20 def object @object end |
#offers ⇒ Object
Returns the value of attribute offers.
20 21 22 |
# File 'lib/rafflesia/registry/repository_data.rb', line 20 def offers @offers end |
#releases ⇒ Object
Returns the value of attribute releases.
20 21 22 |
# File 'lib/rafflesia/registry/repository_data.rb', line 20 def releases @releases end |
#revision_pointers ⇒ Object
Returns the value of attribute revision_pointers.
20 21 22 |
# File 'lib/rafflesia/registry/repository_data.rb', line 20 def revision_pointers @revision_pointers end |
#revisions ⇒ Object
Returns the value of attribute revisions.
20 21 22 |
# File 'lib/rafflesia/registry/repository_data.rb', line 20 def revisions @revisions end |
#summary ⇒ Object
Returns the value of attribute summary.
20 21 22 |
# File 'lib/rafflesia/registry/repository_data.rb', line 20 def summary @summary end |