Class: Runbox::EnvironmentSnapshot
- Inherits:
-
Object
- Object
- Runbox::EnvironmentSnapshot
- Defined in:
- lib/runbox/setup_result.rb
Instance Attribute Summary collapse
-
#os_name ⇒ Object
readonly
Returns the value of attribute os_name.
-
#os_version ⇒ Object
readonly
Returns the value of attribute os_version.
-
#packages ⇒ Object
readonly
Returns the value of attribute packages.
-
#runtime_name ⇒ Object
readonly
Returns the value of attribute runtime_name.
-
#runtime_version ⇒ Object
readonly
Returns the value of attribute runtime_version.
Instance Method Summary collapse
-
#initialize(data) ⇒ EnvironmentSnapshot
constructor
A new instance of EnvironmentSnapshot.
- #to_h ⇒ Object
Constructor Details
#initialize(data) ⇒ EnvironmentSnapshot
Returns a new instance of EnvironmentSnapshot.
31 32 33 34 35 36 37 |
# File 'lib/runbox/setup_result.rb', line 31 def initialize(data) @os_name = data["os_name"] || data[:os_name] @os_version = data["os_version"] || data[:os_version] @runtime_name = data["runtime_name"] || data[:runtime_name] @runtime_version = data["runtime_version"] || data[:runtime_version] @packages = data["packages"] || data[:packages] || {} end |
Instance Attribute Details
#os_name ⇒ Object (readonly)
Returns the value of attribute os_name.
29 30 31 |
# File 'lib/runbox/setup_result.rb', line 29 def os_name @os_name end |
#os_version ⇒ Object (readonly)
Returns the value of attribute os_version.
29 30 31 |
# File 'lib/runbox/setup_result.rb', line 29 def os_version @os_version end |
#packages ⇒ Object (readonly)
Returns the value of attribute packages.
29 30 31 |
# File 'lib/runbox/setup_result.rb', line 29 def packages @packages end |
#runtime_name ⇒ Object (readonly)
Returns the value of attribute runtime_name.
29 30 31 |
# File 'lib/runbox/setup_result.rb', line 29 def runtime_name @runtime_name end |
#runtime_version ⇒ Object (readonly)
Returns the value of attribute runtime_version.
29 30 31 |
# File 'lib/runbox/setup_result.rb', line 29 def runtime_version @runtime_version end |
Instance Method Details
#to_h ⇒ Object
39 40 41 42 43 44 45 46 47 |
# File 'lib/runbox/setup_result.rb', line 39 def to_h { os_name: @os_name, os_version: @os_version, runtime_name: @runtime_name, runtime_version: @runtime_version, packages: @packages } end |