Class: BrickFTP::Webhook::Request
- Inherits:
-
Object
- Object
- BrickFTP::Webhook::Request
- Defined in:
- lib/brick_ftp/webhook/request.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#at ⇒ Object
readonly
Returns the value of attribute at.
-
#destination ⇒ Object
readonly
Returns the value of attribute destination.
-
#interface ⇒ Object
readonly
Returns the value of attribute interface.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(action: nil, interface: nil, path: nil, destination: nil, at: nil, username: nil, type: nil) ⇒ Request
constructor
A new instance of Request.
Constructor Details
#initialize(action: nil, interface: nil, path: nil, destination: nil, at: nil, username: nil, type: nil) ⇒ Request
Returns a new instance of Request.
17 18 19 20 21 22 23 24 25 |
# File 'lib/brick_ftp/webhook/request.rb', line 17 def initialize(action: nil, interface: nil, path: nil, destination: nil, at: nil, username: nil, type: nil) @action = action @interface = interface @path = path @destination = destination @at = at @username = username @type = type end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
6 7 8 |
# File 'lib/brick_ftp/webhook/request.rb', line 6 def action @action end |
#at ⇒ Object (readonly)
Returns the value of attribute at.
6 7 8 |
# File 'lib/brick_ftp/webhook/request.rb', line 6 def at @at end |
#destination ⇒ Object (readonly)
Returns the value of attribute destination.
6 7 8 |
# File 'lib/brick_ftp/webhook/request.rb', line 6 def destination @destination end |
#interface ⇒ Object (readonly)
Returns the value of attribute interface.
6 7 8 |
# File 'lib/brick_ftp/webhook/request.rb', line 6 def interface @interface end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
6 7 8 |
# File 'lib/brick_ftp/webhook/request.rb', line 6 def path @path end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/brick_ftp/webhook/request.rb', line 6 def type @type end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
6 7 8 |
# File 'lib/brick_ftp/webhook/request.rb', line 6 def username @username end |
Class Method Details
.from_query_string(query_string) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/brick_ftp/webhook/request.rb', line 8 def self.from_query_string(query_string) params = query_string.split('&').each_with_object({}) do |pair, res| key, value = pair.split('=').map { |x| CGI.unescape(x) } res[key.to_sym] = value end new(params) end |