Class: Tuiter::User

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = nil) ⇒ User

Returns a new instance of User.



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/tuiter/data/user.rb', line 30

def initialize(data = nil)
  unless data.nil?
    @id = data["id"]
    @name = data["name"]
    @screen_name = data["screen_name"]
    @location = data["location"]
    @description = data["description"]
    @profile_image_url = data["profile_image_url"]
    @url = data["url"]
    @protected = data["protected"]
    @followers_count = data["followers_count"]
    @profile_background_color = data["profile_background_color"]
    @profile_text_color = data["profile_text_color"]
    @profile_link_color = data["profile_link_color"]
    @profile_sidebar_fill_color = data["profile_sidebar_fill_color"]
    @profile_sidebar_border_color = data["profile_sidebar_border_color"]
    @friends_count = data["friends_count"].to_i
    @created_at = (data["created_at"] ? DateTime.parse(data["created_at"]) : DateTime.now)
    @favourites_count = data["favourites_count"].to_i
    @utc_offset = data["utc_offset"]
    @time_zone = data["time_zone"]
    @profile_background_image_url = data["profile_background_image_url"]
    @profile_background_tile = data["profile_background_tile"]
    @statuses_count = data["statuses_count"].to_i
    @notifications = data["notifications"]
    @following = data["following"]
    @status = StatusBasic.new(data["status"])
  else
    @created_at = DateTime.now
  end
end

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at.



19
20
21
# File 'lib/tuiter/data/user.rb', line 19

def created_at
  @created_at
end

#descriptionObject

Returns the value of attribute description.



8
9
10
# File 'lib/tuiter/data/user.rb', line 8

def description
  @description
end

#favourites_countObject

Returns the value of attribute favourites_count.



20
21
22
# File 'lib/tuiter/data/user.rb', line 20

def favourites_count
  @favourites_count
end

#followers_countObject

Returns the value of attribute followers_count.



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

def followers_count
  @followers_count
end

#followingObject

Returns the value of attribute following.



27
28
29
# File 'lib/tuiter/data/user.rb', line 27

def following
  @following
end

#friends_countObject

Returns the value of attribute friends_count.



18
19
20
# File 'lib/tuiter/data/user.rb', line 18

def friends_count
  @friends_count
end

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/tuiter/data/user.rb', line 4

def id
  @id
end

#locationObject

Returns the value of attribute location.



7
8
9
# File 'lib/tuiter/data/user.rb', line 7

def location
  @location
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/tuiter/data/user.rb', line 5

def name
  @name
end

#notificationsObject

Returns the value of attribute notifications.



26
27
28
# File 'lib/tuiter/data/user.rb', line 26

def notifications
  @notifications
end

#profile_background_colorObject

Returns the value of attribute profile_background_color.



13
14
15
# File 'lib/tuiter/data/user.rb', line 13

def profile_background_color
  @profile_background_color
end

#profile_background_image_urlObject

Returns the value of attribute profile_background_image_url.



23
24
25
# File 'lib/tuiter/data/user.rb', line 23

def profile_background_image_url
  @profile_background_image_url
end

#profile_background_tileObject

Returns the value of attribute profile_background_tile.



24
25
26
# File 'lib/tuiter/data/user.rb', line 24

def profile_background_tile
  @profile_background_tile
end

#profile_image_urlObject

Returns the value of attribute profile_image_url.



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

def profile_image_url
  @profile_image_url
end

Returns the value of attribute profile_link_color.



15
16
17
# File 'lib/tuiter/data/user.rb', line 15

def profile_link_color
  @profile_link_color
end

#profile_sidebar_border_colorObject

Returns the value of attribute profile_sidebar_border_color.



17
18
19
# File 'lib/tuiter/data/user.rb', line 17

def profile_sidebar_border_color
  @profile_sidebar_border_color
end

#profile_sidebar_fill_colorObject

Returns the value of attribute profile_sidebar_fill_color.



16
17
18
# File 'lib/tuiter/data/user.rb', line 16

def profile_sidebar_fill_color
  @profile_sidebar_fill_color
end

#profile_text_colorObject

Returns the value of attribute profile_text_color.



14
15
16
# File 'lib/tuiter/data/user.rb', line 14

def profile_text_color
  @profile_text_color
end

#protectedObject

Returns the value of attribute protected.



11
12
13
# File 'lib/tuiter/data/user.rb', line 11

def protected
  @protected
end

#screen_nameObject

Returns the value of attribute screen_name.



6
7
8
# File 'lib/tuiter/data/user.rb', line 6

def screen_name
  @screen_name
end

#statusObject

Returns the value of attribute status.



28
29
30
# File 'lib/tuiter/data/user.rb', line 28

def status
  @status
end

#statuses_countObject

Returns the value of attribute statuses_count.



25
26
27
# File 'lib/tuiter/data/user.rb', line 25

def statuses_count
  @statuses_count
end

#time_zoneObject

Returns the value of attribute time_zone.



22
23
24
# File 'lib/tuiter/data/user.rb', line 22

def time_zone
  @time_zone
end

#urlObject

Returns the value of attribute url.



10
11
12
# File 'lib/tuiter/data/user.rb', line 10

def url
  @url
end

#utc_offsetObject

Returns the value of attribute utc_offset.



21
22
23
# File 'lib/tuiter/data/user.rb', line 21

def utc_offset
  @utc_offset
end