Class: Inferno::DSL::SuiteOption
- Inherits:
-
Object
- Object
- Inferno::DSL::SuiteOption
- Includes:
- Entities::Attributes
- Defined in:
- lib/inferno/dsl/suite_option.rb
Overview
This class is used to represent TestSuite-level options which are selected by the user, and can affect which tests/groups are displayed and run as well as the behavior of those tests.
Constant Summary collapse
- ATTRIBUTES =
[ :id, :title, :description, :list_options, :value ].freeze
Instance Attribute Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(raw_params) ⇒ SuiteOption
constructor
A new instance of SuiteOption.
- #to_hash ⇒ Object
Methods included from Entities::Attributes
Constructor Details
#initialize(raw_params) ⇒ SuiteOption
Returns a new instance of SuiteOption.
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/inferno/dsl/suite_option.rb', line 28 def initialize(raw_params) params = raw_params.deep_symbolize_keys bad_params = params.keys - ATTRIBUTES raise Exceptions::UnknownAttributeException.new(bad_params, self.class) if bad_params.present? params .compact .each { |key, value| send("#{key}=", value) } self.id = id.to_sym if id.is_a? String end |
Instance Attribute Details
#description ⇒ Object
|
# File 'lib/inferno/dsl/suite_option.rb', line 21
|
#id ⇒ Object
|
# File 'lib/inferno/dsl/suite_option.rb', line 21
|
#list_options ⇒ Object
|
# File 'lib/inferno/dsl/suite_option.rb', line 21
|
#title ⇒ Object
|
# File 'lib/inferno/dsl/suite_option.rb', line 21
|
#value ⇒ Object
|
# File 'lib/inferno/dsl/suite_option.rb', line 21
|
Instance Method Details
#==(other) ⇒ Object
42 43 44 |
# File 'lib/inferno/dsl/suite_option.rb', line 42 def ==(other) id == other.id && value == other.value end |
#to_hash ⇒ Object
47 48 49 50 51 |
# File 'lib/inferno/dsl/suite_option.rb', line 47 def to_hash self.class::ATTRIBUTES.each_with_object({}) do |attribute, hash| hash[attribute] = send(attribute) end.compact end |