Class: Oval::ArrayItem
Instance Attribute Summary collapse
-
#item_decl ⇒ Object
readonly
Returns the value of attribute item_decl.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(item_decl) ⇒ ArrayItem
constructor
A new instance of ArrayItem.
- #validate(item, i, subject = nil) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(item_decl) ⇒ ArrayItem
Returns a new instance of ArrayItem.
14 15 16 |
# File 'lib/oval/array_item.rb', line 14 def initialize(item_decl) self.item_decl = item_decl end |
Instance Attribute Details
#item_decl ⇒ Object
Returns the value of attribute item_decl.
18 19 20 |
# File 'lib/oval/array_item.rb', line 18 def item_decl @item_decl end |
Class Method Details
.[](item_decl) ⇒ Object
10 11 12 |
# File 'lib/oval/array_item.rb', line 10 def self.[](item_decl) new(item_decl) end |
Instance Method Details
#validate(item, i, subject = nil) ⇒ Object
5 6 7 8 |
# File 'lib/oval/array_item.rb', line 5 def validate(item, i, subject = nil) item_subject = subject.nil? ? nil : "#{subject}[#{i}]" self.class.ensure_match(item,item_decl,item_subject) end |