Class: Zas::Credentials

Inherits:
Object
  • Object
show all
Defined in:
lib/zas/credentials.rb

Overview

Public: Handle credentials as a Hash

Instance Method Summary collapse

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_wireObject

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