Class: Super::Assets::Asset

Inherits:
Object
  • Object
show all
Defined in:
lib/super/assets.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(handler:, path:, arguments:) ⇒ Asset

Returns a new instance of Asset.



45
46
47
48
49
# File 'lib/super/assets.rb', line 45

def initialize(handler:, path:, arguments:)
  @handler = handler
  @path = path
  @arguments = arguments
end

Instance Attribute Details

#argumentsObject (readonly)

Returns the value of attribute arguments.



53
54
55
# File 'lib/super/assets.rb', line 53

def arguments
  @arguments
end

#handlerObject

Returns the value of attribute handler.



51
52
53
# File 'lib/super/assets.rb', line 51

def handler
  @handler
end

#pathObject (readonly)

Returns the value of attribute path.



52
53
54
# File 'lib/super/assets.rb', line 52

def path
  @path
end

Instance Method Details

#==(other) ⇒ Object



55
56
57
58
59
60
61
# File 'lib/super/assets.rb', line 55

def ==(other)
  return false if handler != other.handler
  return false if path != other.path
  return false if arguments != other.arguments

  true
end

#===(other) ⇒ Object



63
64
65
66
67
68
69
70
71
# File 'lib/super/assets.rb', line 63

def ===(other)
  return true if path == other
  return true if other.is_a?(Regexp) && path.match?(other)
  return true if handler == other
  return true if handler.to_sym == other
  return true if handler.to_s == other

  false
end