Class: Zas::Credentials
- Inherits:
-
Object
- Object
- Zas::Credentials
- Defined in:
- lib/zas/credentials.rb
Overview
Public: Handle credentials as a Hash
Instance Method Summary collapse
-
#initialize(credentials) ⇒ Credentials
constructor
Public: Initialize the credentials with the given Hash.
-
#to_wire ⇒ Object
Public: Construct a wire representation of the credentials.
Constructor Details
#initialize(credentials) ⇒ Credentials
Public: Initialize the credentials with the given Hash.
credentials - A Hash with the keys :username and :password
7 8 9 |
# File 'lib/zas/credentials.rb', line 7 def initialize(credentials) self.credentials = credentials end |
Instance Method Details
#to_wire ⇒ Object
Public: Construct a wire representation of the credentials
Returns the encoded JSON
14 15 16 |
# File 'lib/zas/credentials.rb', line 14 def to_wire Yajl::Encoder.encode({:strategy => :auth, :credentials => credentials}) end |