Class: Omnitest::Core::Dash
- Inherits:
-
Hashie::Dash
- Object
- Hashie::Dash
- Omnitest::Core::Dash
- Includes:
- Hashie::Extensions::Coercion
- Defined in:
- lib/omnitest/core/hashie.rb
Defined Under Namespace
Modules: Loadable
Class Method Summary collapse
-
.field(name, type, opts = {}) ⇒ Object
private
Defines a typed attribute on a class.
-
.required_field(name, type, opts = {}) ⇒ Object
private
Defines a required, typed attribute on a class.
Instance Method Summary collapse
-
#initialize(hash = {}) ⇒ Dash
constructor
A new instance of Dash.
Constructor Details
#initialize(hash = {}) ⇒ Dash
Returns a new instance of Dash.
9 10 11 |
# File 'lib/omnitest/core/hashie.rb', line 9 def initialize(hash = {}) super Omnitest::Core::Util.symbolized_hash(hash) end |
Class Method Details
.field(name, type, opts = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Defines a typed attribute on a class.
19 20 21 22 |
# File 'lib/omnitest/core/hashie.rb', line 19 def self.field(name, type, opts = {}) property name, opts coerce_key name, type end |
.required_field(name, type, opts = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Defines a required, typed attribute on a class.
30 31 32 33 |
# File 'lib/omnitest/core/hashie.rb', line 30 def self.required_field(name, type, opts = {}) opts[:required] = true field(name, type, opts) end |