Class: Prospectus::List

Inherits:
Object
  • Object
show all
Defined in:
lib/prospectus/list.rb

Overview

Define list object that contains items

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ List

Returns a new instance of List.



5
6
7
# File 'lib/prospectus/list.rb', line 5

def initialize(params = {})
  @options = params
end

Instance Method Details

#checkObject



13
14
15
16
17
18
19
# File 'lib/prospectus/list.rb', line 13

def check
  all, good_only = @options.values_at(:all, :good_only)
  items.select do |x|
    match = x.actual =~ x.expected
    true if all || (!match ^ good_only)
  end
end

#itemsObject



9
10
11
# File 'lib/prospectus/list.rb', line 9

def items
  @items ||= []
end