Class: Oval::Options
Instance Attribute Summary collapse
-
#decl ⇒ Object
readonly
Returns the value of attribute decl.
Instance Method Summary collapse
-
#initialize(decl) ⇒ Options
constructor
A new instance of Options.
- #validate(options, subject = nil) ⇒ Object
Methods inherited from Base
[], ensure_equal, it_should, #it_should, validate
Constructor Details
#initialize(decl) ⇒ Options
Returns a new instance of Options.
13 14 15 |
# File 'lib/oval/options.rb', line 13 def initialize(decl) self.decl = decl end |
Instance Attribute Details
#decl ⇒ Object
Returns the value of attribute decl.
17 18 19 |
# File 'lib/oval/options.rb', line 17 def decl @decl end |
Instance Method Details
#validate(options, subject = nil) ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/oval/options.rb', line 4 def validate(, subject = nil) unless .is_a?(Hash) raise Oval::ValueError, "Invalid options #{.inspect} of type #{.class.name}. " + "Should be a Hash" end .each {|name, value| validate_option(name, value, subject) } end |