Class: Brauser::Definitions::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/brauser/definitions/base.rb

Overview

A class which hold a definition of a browser, a platform or a language.

Direct Known Subclasses

Browser, Language, Platform

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#idObject (readonly)

Returns The id of the definition.

Returns:

  • The id of the definition.



60
61
62
63
64
65
66
67
68
69
# File 'lib/brauser/definitions/base.rb', line 60

class Base
  attr_reader :id

  # Performs a match of this definition.
  #
  # @return [Object|NilClass] A non falsy value if match succeeded, `false` or `nil` otherwise.
  def match(_, *_, **_)
    raise "Must be overridden by a subclass."
  end
end

Instance Method Details

#match(_, *_, **_) ⇒ Object|NilClass

Performs a match of this definition.

Returns:

  • (Object|NilClass)

    A non falsy value if match succeeded, false or nil otherwise.



66
67
68
# File 'lib/brauser/definitions/base.rb', line 66

def match(_, *_, **_)
  raise "Must be overridden by a subclass."
end