Module: Diversion::Configurable
Instance Attribute Summary collapse
-
#encode_uris ⇒ Object
Returns the value of attribute encode_uris.
-
#host ⇒ Object
Returns the value of attribute host.
-
#path ⇒ Object
Returns the value of attribute path.
-
#port ⇒ Object
Returns the value of attribute port.
-
#sign_key ⇒ Object
Returns the value of attribute sign_key.
-
#sign_length ⇒ Object
Returns the value of attribute sign_length.
-
#url_decoding ⇒ Object
Returns the value of attribute url_decoding.
-
#url_encoding ⇒ Object
Returns the value of attribute url_encoding.
Class Method Summary collapse
Instance Method Summary collapse
- #configure {|_self| ... } ⇒ Object
- #reset! ⇒ Object (also: #setup)
Instance Attribute Details
#encode_uris ⇒ Object
Returns the value of attribute encode_uris.
7 8 9 |
# File 'lib/diversion/configurable.rb', line 7 def encode_uris @encode_uris end |
#host ⇒ Object
Returns the value of attribute host.
7 8 9 |
# File 'lib/diversion/configurable.rb', line 7 def host @host end |
#path ⇒ Object
Returns the value of attribute path.
7 8 9 |
# File 'lib/diversion/configurable.rb', line 7 def path @path end |
#port ⇒ Object
Returns the value of attribute port.
7 8 9 |
# File 'lib/diversion/configurable.rb', line 7 def port @port end |
#sign_key ⇒ Object
Returns the value of attribute sign_key.
7 8 9 |
# File 'lib/diversion/configurable.rb', line 7 def sign_key @sign_key end |
#sign_length ⇒ Object
Returns the value of attribute sign_length.
7 8 9 |
# File 'lib/diversion/configurable.rb', line 7 def sign_length @sign_length end |
#url_decoding ⇒ Object
Returns the value of attribute url_decoding.
8 9 10 |
# File 'lib/diversion/configurable.rb', line 8 def url_decoding @url_decoding end |
#url_encoding ⇒ Object
Returns the value of attribute url_encoding.
8 9 10 |
# File 'lib/diversion/configurable.rb', line 8 def url_encoding @url_encoding end |
Class Method Details
.keys ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/diversion/configurable.rb', line 13 def keys @keys ||= [ :host, :port, :path, :sign_key, :sign_length, :encode_uris, :url_encoding, :url_decoding ] end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
28 29 30 31 32 |
# File 'lib/diversion/configurable.rb', line 28 def configure yield self validate_configuration! self end |
#reset! ⇒ Object Also known as: setup
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/diversion/configurable.rb', line 34 def reset! @host = 'http://localhost.domain' @port = 80 @path = '/redirect/1/' @sign_length = 0 @sign_key = nil @encode_uris = ['http','https'] @url_encoding = Encode::Params @url_decoding = Decode::Params validate_configuration! self end |