Class: AWS::Core::Http::Request::Param
- Inherits:
-
Object
- Object
- AWS::Core::Http::Request::Param
- Includes:
- UriEscape
- Defined in:
- lib/aws/core/http/request.rb
Overview
Represents a single request paramater. Some services accept this in a form encoded body string, others as query parameters. It is up to each service’s Request class to determine how to consume these params.
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #==(other) ⇒ Object
- #encoded ⇒ Object
-
#initialize(name, value = nil) ⇒ Param
constructor
A new instance of Param.
- #to_s ⇒ Object
Methods included from UriEscape
Constructor Details
#initialize(name, value = nil) ⇒ Param
Returns a new instance of Param.
224 225 226 227 |
# File 'lib/aws/core/http/request.rb', line 224 def initialize name, value = nil @name = name @value = value end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
222 223 224 |
# File 'lib/aws/core/http/request.rb', line 222 def name @name end |
#value ⇒ Object
Returns the value of attribute value.
222 223 224 |
# File 'lib/aws/core/http/request.rb', line 222 def value @value end |
Instance Method Details
#<=>(other) ⇒ Object
229 230 231 |
# File 'lib/aws/core/http/request.rb', line 229 def <=> other name <=> other.name end |
#==(other) ⇒ Object
237 238 239 |
# File 'lib/aws/core/http/request.rb', line 237 def ==(other) other.kind_of?(Param) and to_s == other.to_s end |
#encoded ⇒ Object
241 242 243 |
# File 'lib/aws/core/http/request.rb', line 241 def encoded value ? "#{escape(name)}=#{escape(value)}" : escape(name) end |
#to_s ⇒ Object
233 234 235 |
# File 'lib/aws/core/http/request.rb', line 233 def to_s value ? "#{name}=#{value}" : name end |