Class: ReliableMsg::Selector::Header

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

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Header

Returns a new instance of Header.



73
74
75
# File 'lib/reliable-msg/selector.rb', line 73

def initialize name
    @name = name
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(symbol, *args) ⇒ Object



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

def method_missing symbol, *args
    if symbol == :__evaluate__
        args[0][@name]
    else
        Deferred.new self, symbol, args
    end
end

Instance Method Details

#coerce(value) ⇒ Object



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

def coerce value
    [Constant.new(value), self]
end