Class: ReliableMsg::EvaluationContext

Inherits:
Object
  • Object
show all
Defined in:
lib/reliable-msg/selector.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(headers) ⇒ EvaluationContext

Returns a new instance of EvaluationContext.



77
78
79
# File 'lib/reliable-msg/selector.rb', line 77

def initialize headers
    @headers = headers
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(symbol, *args, &block) ⇒ Object

Raises:

  • (ArgumentError)


92
93
94
95
# File 'lib/reliable-msg/selector.rb', line 92

def method_missing symbol, *args, &block
    raise ArgumentError, "Wrong number of arguments (#{args.length} for 0)" unless args.empty?
    @headers[symbol]
end

Instance Method Details

#[](symbol) ⇒ Object



87
88
89
# File 'lib/reliable-msg/selector.rb', line 87

def [] symbol
    @headers[symbol]
end

#nowObject



82
83
84
# File 'lib/reliable-msg/selector.rb', line 82

def now
    Time.now.to_i
end