Class: ActiveAgent::Delegation::Pricing::Rate

Inherits:
Struct
  • Object
show all
Defined in:
lib/active_agent/delegation/pricing.rb

Overview

A registered rate card.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#inputObject

Returns the value of attribute input

Returns:

  • (Object)

    the current value of input



24
25
26
# File 'lib/active_agent/delegation/pricing.rb', line 24

def input
  @input
end

#outputObject

Returns the value of attribute output

Returns:

  • (Object)

    the current value of output



24
25
26
# File 'lib/active_agent/delegation/pricing.rb', line 24

def output
  @output
end

#patternObject

Returns the value of attribute pattern

Returns:

  • (Object)

    the current value of pattern



24
25
26
# File 'lib/active_agent/delegation/pricing.rb', line 24

def pattern
  @pattern
end

Instance Method Details

#matches?(model) ⇒ Boolean

Parameters:

  • model (String)

Returns:

  • (Boolean)


27
28
29
30
31
32
# File 'lib/active_agent/delegation/pricing.rb', line 27

def matches?(model)
  case pattern
  when Regexp then pattern.match?(model)
  else model.to_s.start_with?(pattern.to_s)
  end
end