Class: Eventick::Auth

Inherits:
Base
  • Object
show all
Defined in:
lib/eventick/auth.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

path, resource

Constructor Details

#initialize(&block) ⇒ Auth

Returns a new instance of Auth.



8
9
10
# File 'lib/eventick/auth.rb', line 8

def initialize(&block)
  block.call self if block_given?
end

Instance Attribute Details

#emailObject

Returns the value of attribute email.



5
6
7
# File 'lib/eventick/auth.rb', line 5

def email
  @email
end

#password=(value) ⇒ Object (writeonly)

Sets the attribute password

Parameters:

  • value

    the value to set the attribute password to.



6
7
8
# File 'lib/eventick/auth.rb', line 6

def password=(value)
  @password = value
end

Instance Method Details

#authenticated?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/eventick/auth.rb', line 16

def authenticated?
  !!@token
end

#tokenObject



12
13
14
# File 'lib/eventick/auth.rb', line 12

def token
  @token ||= (get)['token']
end