Class: Epuber::Book::FileRequest
- Inherits:
-
Object
- Object
- Epuber::Book::FileRequest
- Defined in:
- lib/epuber/book/file_request.rb
Instance Attribute Summary collapse
- #group ⇒ Symbol
-
#only_one ⇒ Bool
When looking for file, the resulted list should contain only one file.
- #properties ⇒ Set<String>
- #source_pattern ⇒ String
Instance Method Summary collapse
- #==(other) ⇒ Object
- #eql?(other) ⇒ Bool
- #hash ⇒ Numeric
-
#initialize(source_pattern, only_one: true, group: nil, properties: []) ⇒ FileRequest
constructor
A new instance of FileRequest.
- #to_s ⇒ String
Constructor Details
#initialize(source_pattern, only_one: true, group: nil, properties: []) ⇒ FileRequest
Returns a new instance of FileRequest.
32 33 34 35 36 37 |
# File 'lib/epuber/book/file_request.rb', line 32 def initialize(source_pattern, only_one: true, group: nil, properties: []) @source_pattern = source_pattern @only_one = only_one @group = group @properties = properties.to_set end |
Instance Attribute Details
#group ⇒ Symbol
12 13 14 |
# File 'lib/epuber/book/file_request.rb', line 12 def group @group end |
#only_one ⇒ Bool
When looking for file, the resulted list should contain only one file
Default: true
20 21 22 |
# File 'lib/epuber/book/file_request.rb', line 20 def only_one @only_one end |
#properties ⇒ Set<String>
24 25 26 |
# File 'lib/epuber/book/file_request.rb', line 24 def properties @properties end |
#source_pattern ⇒ String
8 9 10 |
# File 'lib/epuber/book/file_request.rb', line 8 def source_pattern @source_pattern end |
Instance Method Details
#==(other) ⇒ Object
53 54 55 56 57 58 59 |
# File 'lib/epuber/book/file_request.rb', line 53 def ==(other) if other.is_a?(String) @source_pattern == other else @source_pattern == other.source_pattern && @group == other.group && @only_one == other.only_one end end |
#eql?(other) ⇒ Bool
41 42 43 |
# File 'lib/epuber/book/file_request.rb', line 41 def eql?(other) self == other end |
#hash ⇒ Numeric
47 48 49 |
# File 'lib/epuber/book/file_request.rb', line 47 def hash [@source_pattern, @group, @only_one].hash end |
#to_s ⇒ String
63 64 65 |
# File 'lib/epuber/book/file_request.rb', line 63 def to_s "#<#{self.class} pattern:`#{@source_pattern}` group:`#{@group}` only_one:`#{@only_one}`>" end |