Class: PossibleEmail::Profile

Inherits:
Object
  • Object
show all
Defined in:
lib/possible_email/profile/profile.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Profile

Returns a new instance of Profile.



12
13
14
15
16
17
# File 'lib/possible_email/profile/profile.rb', line 12

def initialize(data)
  @data = data

  retrieve_attribute
  retrieve_attribute_collection
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



8
9
10
# File 'lib/possible_email/profile/profile.rb', line 8

def data
  @data
end

#emailObject (readonly)

Returns the value of attribute email.



8
9
10
# File 'lib/possible_email/profile/profile.rb', line 8

def email
  @email
end

#first_nameObject (readonly)

Returns the value of attribute first_name.



8
9
10
# File 'lib/possible_email/profile/profile.rb', line 8

def first_name
  @first_name
end

#friendly_nameObject (readonly)

Returns the value of attribute friendly_name.



8
9
10
# File 'lib/possible_email/profile/profile.rb', line 8

def friendly_name
  @friendly_name
end

#headlineObject (readonly)

Returns the value of attribute headline.



8
9
10
# File 'lib/possible_email/profile/profile.rb', line 8

def headline
  @headline
end

#imagesObject (readonly)

Returns the value of attribute images.



8
9
10
# File 'lib/possible_email/profile/profile.rb', line 8

def images
  @images
end

#last_nameObject (readonly)

Returns the value of attribute last_name.



8
9
10
# File 'lib/possible_email/profile/profile.rb', line 8

def last_name
  @last_name
end

#locationObject (readonly)

Returns the value of attribute location.



8
9
10
# File 'lib/possible_email/profile/profile.rb', line 8

def location
  @location
end

#membershipsObject (readonly)

Returns the value of attribute memberships.



8
9
10
# File 'lib/possible_email/profile/profile.rb', line 8

def memberships
  @memberships
end

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/possible_email/profile/profile.rb', line 8

def name
  @name
end

#occupationsObject (readonly)

Returns the value of attribute occupations.



8
9
10
# File 'lib/possible_email/profile/profile.rb', line 8

def occupations
  @occupations
end

#phonesObject (readonly)

Returns the value of attribute phones.



8
9
10
# File 'lib/possible_email/profile/profile.rb', line 8

def phones
  @phones
end

#successObject (readonly)

Returns the value of attribute success.



8
9
10
# File 'lib/possible_email/profile/profile.rb', line 8

def success
  @success
end

Instance Method Details

#attributesObject



19
20
21
# File 'lib/possible_email/profile/profile.rb', line 19

def attributes
  instance_variables.select { |i| i != :@data }.map { |i| i.to_s[1..-1] }
end

#to_sObject



23
24
25
# File 'lib/possible_email/profile/profile.rb', line 23

def to_s
  "#{@name} - #{email}"
end