Module: Dizby::BasicProtocol::ClassMethods

Defined in:
lib/dizby/protocol/basic.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#scheme

Returns the value of attribute scheme


10
11
12
# File 'lib/dizby/protocol/basic.rb', line 10

def scheme
  @scheme
end

Instance Method Details

#get_refinement(type)


12
13
14
15
16
# File 'lib/dizby/protocol/basic.rb', line 12

def get_refinement(type)
  instance_variable_get(:"@#{type}_refined")
rescue NameError
  nil
end

#refine(type, regex, &block) (protected)


22
23
24
25
# File 'lib/dizby/protocol/basic.rb', line 22

def refine(type, regex, &block)
  refined = RefinedProtocol.new(regex, &block)
  instance_variable_set(:"@#{type}_refined", refined)
end