Class: OsRule
Instance Attribute Summary collapse
-
#os ⇒ Object
Returns the value of attribute os.
-
#os_arch ⇒ Object
Returns the value of attribute os_arch.
-
#os_version ⇒ Object
Returns the value of attribute os_version.
Attributes inherited from Rule
Instance Method Summary collapse
-
#initialize(action, os, os_version = nil, os_arch = nil) ⇒ OsRule
constructor
A new instance of OsRule.
- #to_json ⇒ Object
Methods inherited from Rule
Constructor Details
#initialize(action, os, os_version = nil, os_arch = nil) ⇒ OsRule
Returns a new instance of OsRule.
41 42 43 44 45 46 |
# File 'lib/wonko_the_sane/rules.rb', line 41 def initialize(action, os, os_version = nil, os_arch = nil) super(action) @os = os @os_version = os_version @os_arch = os_arch end |
Instance Attribute Details
#os ⇒ Object
Returns the value of attribute os.
37 38 39 |
# File 'lib/wonko_the_sane/rules.rb', line 37 def os @os end |
#os_arch ⇒ Object
Returns the value of attribute os_arch.
39 40 41 |
# File 'lib/wonko_the_sane/rules.rb', line 39 def os_arch @os_arch end |
#os_version ⇒ Object
Returns the value of attribute os_version.
38 39 40 |
# File 'lib/wonko_the_sane/rules.rb', line 38 def os_version @os_version end |
Instance Method Details
#to_json ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/wonko_the_sane/rules.rb', line 48 def to_json obj = super obj[:os] = { name: @os } obj[:os][:version] = @os_version if @os_version obj[:os][:arch] = @os_arch if @os_arch obj end |