Class: Rafflesia::HealthData
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::HealthData
- Defined in:
- lib/rafflesia/system/health_data.rb
Constant Summary collapse
- HASH_ATTRS =
{ build: :build, data_dir: :data_dir, dependencies: :dependencies, mode: :mode, runtime: :runtime, runtime_profile: :runtime_profile, status: :status, version: :version }.freeze
Instance Attribute Summary collapse
-
#build ⇒ Object
Returns the value of attribute build.
-
#data_dir ⇒ Object
Returns the value of attribute data_dir.
-
#dependencies ⇒ Object
Returns the value of attribute dependencies.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#runtime ⇒ Object
Returns the value of attribute runtime.
-
#runtime_profile ⇒ Object
Returns the value of attribute runtime_profile.
-
#status ⇒ Object
Returns the value of attribute status.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(json) ⇒ HealthData
constructor
A new instance of HealthData.
Constructor Details
#initialize(json) ⇒ HealthData
Returns a new instance of HealthData.
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/rafflesia/system/health_data.rb', line 29 def initialize(json) super() hash = self.class.normalize(json) @build = hash[:build] ? Rafflesia::BuildInfo.new(hash[:build]) : nil @data_dir = hash[:data_dir] @dependencies = (hash[:dependencies] || []).map { |item| item ? Rafflesia::DependencyStatus.new(item) : nil } @mode = hash[:mode] @runtime = (hash[:runtime] || []).map { |item| item ? Rafflesia::RuntimeStatus.new(item) : nil } @runtime_profile = hash[:runtime_profile] @status = hash[:status] @version = hash[:version] end |
Instance Attribute Details
#build ⇒ Object
Returns the value of attribute build.
19 20 21 |
# File 'lib/rafflesia/system/health_data.rb', line 19 def build @build end |
#data_dir ⇒ Object
Returns the value of attribute data_dir.
19 20 21 |
# File 'lib/rafflesia/system/health_data.rb', line 19 def data_dir @data_dir end |
#dependencies ⇒ Object
Returns the value of attribute dependencies.
19 20 21 |
# File 'lib/rafflesia/system/health_data.rb', line 19 def dependencies @dependencies end |
#mode ⇒ Object
Returns the value of attribute mode.
19 20 21 |
# File 'lib/rafflesia/system/health_data.rb', line 19 def mode @mode end |
#runtime ⇒ Object
Returns the value of attribute runtime.
19 20 21 |
# File 'lib/rafflesia/system/health_data.rb', line 19 def runtime @runtime end |
#runtime_profile ⇒ Object
Returns the value of attribute runtime_profile.
19 20 21 |
# File 'lib/rafflesia/system/health_data.rb', line 19 def runtime_profile @runtime_profile end |
#status ⇒ Object
Returns the value of attribute status.
19 20 21 |
# File 'lib/rafflesia/system/health_data.rb', line 19 def status @status end |
#version ⇒ Object
Returns the value of attribute version.
19 20 21 |
# File 'lib/rafflesia/system/health_data.rb', line 19 def version @version end |