class Epuber::Book::FileRequest

Attributes

group[RW]

@return [Symbol]

only_one[RW]

When looking for file, the resulted list should contain only one file

Default: true

@return [Bool]

properties[RW]

@return [Set<String>]

source_pattern[RW]

@return [String]

Public Class Methods

new(source_pattern, only_one: true, group: nil, properties: []) click to toggle source

@param [String] source_pattern pattern describing path to file @param [Bool] only_one find only one file, otherwise look for all files matching pattern in project @param [Symbol] group group of file, see Epuber::Compiler::FileFinder::GROUP_EXTENSIONS @param [Array<Symbol>, Set<Symbol>] properties list of properties

# 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

Public Instance Methods

==(other) click to toggle source

@param [String, self] other

# 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) click to toggle source

@return [Bool]

# File lib/epuber/book/file_request.rb, line 41
def eql?(other)
  self == other
end
hash() click to toggle source

@return [Numeric]

# File lib/epuber/book/file_request.rb, line 47
def hash
  [@source_pattern, @group, @only_one].hash
end
to_s() click to toggle source

@return [String]

# File lib/epuber/book/file_request.rb, line 63
def to_s
  "#<#{self.class} pattern:`#{@source_pattern}` group:`#{@group}` only_one:`#{@only_one}`>"
end