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


8
9
10
# File 'lib/dizby/protocol/basic.rb', line 8

def scheme
  @scheme
end

Instance Method Details

#get_refinement(type)


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

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

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


20
21
22
23
# File 'lib/dizby/protocol/basic.rb', line 20

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