Class: Dizby::RefinedProtocol
- Inherits:
-
Object
- Object
- Dizby::RefinedProtocol
- Defined in:
- lib/dizby/protocol/refined.rb
Instance Attribute Summary collapse
-
#regex
readonly
Returns the value of attribute regex.
Instance Method Summary collapse
- #call(*args)
-
#initialize(regex, &block) ⇒ RefinedProtocol
constructor
A new instance of RefinedProtocol.
Constructor Details
#initialize(regex, &block) ⇒ RefinedProtocol
Returns a new instance of RefinedProtocol.
18 19 20 21 |
# File 'lib/dizby/protocol/refined.rb', line 18 def initialize(regex, &block) @regex = /^#{format(regex, Dizby::PROTOCOL_REGEX)}$/ @block = block end |
Instance Attribute Details
#regex (readonly)
Returns the value of attribute regex.
23 24 25 |
# File 'lib/dizby/protocol/refined.rb', line 23 def regex @regex end |
Instance Method Details
#call(*args)
25 26 27 |
# File 'lib/dizby/protocol/refined.rb', line 25 def call(*args) @block.call(*args) end |