Class: FlexBullet::User

Inherits:
Object
  • Object
show all
Defined in:
lib/flex_bullet/user.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(email, authentication, name = '') ⇒ User

Returns a new instance of User.



5
6
7
8
9
10
# File 'lib/flex_bullet/user.rb', line 5

def initialize (email, authentication, name = '')
  @email  = email
  @name   = name
  @auth   = authentication
  @client = Pushbullet::Client.new(authentication)
end

Instance Attribute Details

#authObject (readonly)

Returns the value of attribute auth.



3
4
5
# File 'lib/flex_bullet/user.rb', line 3

def auth
  @auth
end

#clientObject (readonly)

Returns the value of attribute client.



3
4
5
# File 'lib/flex_bullet/user.rb', line 3

def client
  @client
end

#emailObject (readonly)

Returns the value of attribute email.



3
4
5
# File 'lib/flex_bullet/user.rb', line 3

def email
  @email
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/flex_bullet/user.rb', line 3

def name
  @name
end

Instance Method Details

#message(body) ⇒ Object



12
13
14
# File 'lib/flex_bullet/user.rb', line 12

def message (body)
  Message.new(sender: name, email: email, body: body, user_obj: self)
end