Class: FroyoApi::Name

Inherits:
Client
  • Object
show all
Defined in:
lib/froyo_api/name.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Client

#request

Constructor Details

#initialize(gender = 'm') ⇒ Name

Returns a new instance of Name.



5
6
7
8
9
10
# File 'lib/froyo_api/name.rb', line 5

def initialize(gender = 'm')
  @gender = gender
  @fullname = attributes['fullname']
  @firstname = attributes['firstname']
  @lastname = attributes['lastname']
end

Instance Attribute Details

#firstnameObject (readonly)

Returns the value of attribute firstname.



3
4
5
# File 'lib/froyo_api/name.rb', line 3

def firstname
  @firstname
end

#fullnameObject (readonly)

Returns the value of attribute fullname.



3
4
5
# File 'lib/froyo_api/name.rb', line 3

def fullname
  @fullname
end

#genderObject (readonly)

Returns the value of attribute gender.



3
4
5
# File 'lib/froyo_api/name.rb', line 3

def gender
  @gender
end

#lastnameObject (readonly)

Returns the value of attribute lastname.



3
4
5
# File 'lib/froyo_api/name.rb', line 3

def lastname
  @lastname
end

Instance Method Details

#attributesObject



12
13
14
# File 'lib/froyo_api/name.rb', line 12

def attributes
  @attributes ||= generate
end