Class: Torganiser::FileQuery::ItemsPattern
- Inherits:
-
Object
- Object
- Torganiser::FileQuery::ItemsPattern
- 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
-
#items ⇒ Object
readonly
Returns the value of attribute items.
Instance Method Summary collapse
-
#initialize(items) ⇒ ItemsPattern
constructor
A new instance of ItemsPattern.
- #to_s ⇒ Object
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
#items ⇒ Object (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_s ⇒ Object
50 51 52 |
# File 'lib/torganiser/file_query.rb', line 50 def to_s items.count > 1 ? "{#{items.join(',')}}" : items.first end |