Class: Torganiser::FileQuery::ItemsPattern

Inherits:
Object
  • Object
show all
Defined in:
lib/torganiser/file_query.rb

Overview

Models a pattern that matchers a series of one or more string items.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(items) ⇒ ItemsPattern

Returns a new instance of ItemsPattern.



46
47
48
# File 'lib/torganiser/file_query.rb', line 46

def initialize(items)
  @items = items
end

Instance Attribute Details

#itemsObject (readonly)

Returns the value of attribute items.



44
45
46
# File 'lib/torganiser/file_query.rb', line 44

def items
  @items
end

Instance Method Details

#to_sObject



50
51
52
# File 'lib/torganiser/file_query.rb', line 50

def to_s
  items.count > 1 ?  "{#{items.join(',')}}" : items.first
end