Class: Val::Key::Instance
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(key, it) ⇒ Instance
constructor
A new instance of Instance.
- #ok? ⇒ Boolean
Constructor Details
#initialize(key, it) ⇒ Instance
Returns a new instance of Instance.
188 189 190 191 192 193 194 195 196 |
# File 'lib/val.rb', line 188 def initialize key, it @name, @type = key.name, key.type @value = it[@name] @ok = @type === @value rescue @error = $! @ok = false end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
186 187 188 |
# File 'lib/val.rb', line 186 def error @error end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
186 187 188 |
# File 'lib/val.rb', line 186 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
186 187 188 |
# File 'lib/val.rb', line 186 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
186 187 188 |
# File 'lib/val.rb', line 186 def value @value end |
Instance Method Details
#ok? ⇒ Boolean
198 199 200 |
# File 'lib/val.rb', line 198 def ok? @ok end |