lib/rflow/components/http/extensions.rb in rflow-components-http-1.0.0a2 vs lib/rflow/components/http/extensions.rb in rflow-components-http-1.0.0a3
- old
+ new
@@ -1,12 +1,9 @@
class RFlow
module Components
module HTTP
-
- # The set of extensions to add capability to HTTP data types
module Extensions
-
module IPConnectionExtension
# Default accessors
# TODO: validate the stuffs
['client_ip', 'client_port', 'server_ip', 'server_port'].each do |name|
define_method name do |*args|
@@ -19,11 +16,11 @@
end
# Need to be careful when extending to not clobber data already in data_object
module HTTPRequestExtension
def self.extended(base_data)
- base_data.data_object ||= {'uri' => '/', 'method' => 'GET', 'protocol' => 'HTTP/1.0', 'headers'=>{}, 'content' => ''}
+ base_data.data_object ||= {'uri' => '/', 'method' => 'GET', 'protocol' => 'HTTP/1.0', 'headers' => {}, 'content' => ''}
end
# Default accessors
['method', 'uri', 'query_string', 'protocol', 'headers', 'content'].each do |name|
define_method name do |*args|
@@ -57,12 +54,10 @@
end
define_method :"#{name}=" do |*args|
data_object[name] = args.first.to_i
end
end
-
end
-
end
end
end
end