Class: Gattica::User

Inherits:
Object
  • Object
show all
Includes:
Convertible
Defined in:
lib/gattica/user.rb

Overview

Represents a user to be authenticated by GA

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Convertible

#to_query, #to_s, #to_xml

Constructor Details

#initialize(email, password) ⇒ User

Returns a new instance of User.



11
12
13
14
15
# File 'lib/gattica/user.rb', line 11

def initialize(email,password)
  @email = email
  @password = password
  validate
end

Instance Attribute Details

#emailObject

Returns the value of attribute email.



9
10
11
# File 'lib/gattica/user.rb', line 9

def email
  @email
end

#passwordObject

Returns the value of attribute password.



9
10
11
# File 'lib/gattica/user.rb', line 9

def password
  @password
end

Instance Method Details

#to_hObject

User gets a special to_h because Google expects Email and Passwd instead of our nicer internal names



18
19
20
21
# File 'lib/gattica/user.rb', line 18

def to_h
  { :Email => @email,
    :Passwd => @password }
end