Class: ThinktankExpert

Inherits:
BaseModel show all
Defined in:
lib/models/thinktank_expert.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

fields, register, #verify, #verify_empty, #verify_fields, #verify_int, #verify_json, #verify_length, #verify_regex, #verify_string

Constructor Details

#initialize(options = {}) ⇒ ThinktankExpert

Returns a new instance of ThinktankExpert.



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/models/thinktank_expert.rb', line 43

def initialize(options={})
	options = JSON.parse(options.to_json)
	@id = options["id"]
	@name = options["name"]
	@title = options["title"]
	@content = options["content"]
	@location = options["location"]
	@area_of_expertise = options["area_of_expertise"]
	@profile_images = options["profile_images"]
	@phone = options["phone"]
	@email = options["email"]
	@link = options["link"]
	@audios = options["audios"]
	@videos = options["videos"]
	@education = options["education"]
	@related_topics = options["related_topics"]
	@site_name = options["site_name"]
	@site_name_cn = options["site_name_cn"]
	@domain = options["domain"]
	@created_at = options["created_at"]
	@updated_at = options["updated_at"]
	@source = options["source"]
	@oss_profile_images = options["oss_profile_images"]
	@facebook = options["facebook"]
	@twitter = options["twitter"]
	@linkedin = options["linkedin"]
	@instagram = options["instagram"]
	@wikidata = options["wikidata"]
	@person_type = options["person_type"]
	@files = options["files"]
	@oss_files = options["oss_files"]
	@associated_program = options["associated_program"]
	@lang = options["lang"]
	@website = options["website"]
	@nationalities = options["nationalities"]
end

Instance Attribute Details

#area_of_expertiseObject

Returns the value of attribute area_of_expertise.



7
8
9
# File 'lib/models/thinktank_expert.rb', line 7

def area_of_expertise
  @area_of_expertise
end

#associated_programObject

Returns the value of attribute associated_program.



31
32
33
# File 'lib/models/thinktank_expert.rb', line 31

def associated_program
  @associated_program
end

#audiosObject

Returns the value of attribute audios.



12
13
14
# File 'lib/models/thinktank_expert.rb', line 12

def audios
  @audios
end

#contentObject

Returns the value of attribute content.



5
6
7
# File 'lib/models/thinktank_expert.rb', line 5

def content
  @content
end

#created_atObject

Returns the value of attribute created_at.



19
20
21
# File 'lib/models/thinktank_expert.rb', line 19

def created_at
  @created_at
end

#domainObject

Returns the value of attribute domain.



18
19
20
# File 'lib/models/thinktank_expert.rb', line 18

def domain
  @domain
end

#educationObject

Returns the value of attribute education.



14
15
16
# File 'lib/models/thinktank_expert.rb', line 14

def education
  @education
end

#emailObject

Returns the value of attribute email.



10
11
12
# File 'lib/models/thinktank_expert.rb', line 10

def email
  @email
end

#facebookObject

Returns the value of attribute facebook.



23
24
25
# File 'lib/models/thinktank_expert.rb', line 23

def facebook
  @facebook
end

#filesObject

Returns the value of attribute files.



29
30
31
# File 'lib/models/thinktank_expert.rb', line 29

def files
  @files
end

#idObject

Returns the value of attribute id.



2
3
4
# File 'lib/models/thinktank_expert.rb', line 2

def id
  @id
end

#instagramObject

Returns the value of attribute instagram.



26
27
28
# File 'lib/models/thinktank_expert.rb', line 26

def instagram
  @instagram
end

#langObject

Returns the value of attribute lang.



32
33
34
# File 'lib/models/thinktank_expert.rb', line 32

def lang
  @lang
end

Returns the value of attribute link.



11
12
13
# File 'lib/models/thinktank_expert.rb', line 11

def link
  @link
end

#linkedinObject

Returns the value of attribute linkedin.



25
26
27
# File 'lib/models/thinktank_expert.rb', line 25

def linkedin
  @linkedin
end

#locationObject

Returns the value of attribute location.



6
7
8
# File 'lib/models/thinktank_expert.rb', line 6

def location
  @location
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/models/thinktank_expert.rb', line 3

def name
  @name
end

#nationalitiesObject

Returns the value of attribute nationalities.



34
35
36
# File 'lib/models/thinktank_expert.rb', line 34

def nationalities
  @nationalities
end

#oss_filesObject

Returns the value of attribute oss_files.



30
31
32
# File 'lib/models/thinktank_expert.rb', line 30

def oss_files
  @oss_files
end

#oss_profile_imagesObject

Returns the value of attribute oss_profile_images.



22
23
24
# File 'lib/models/thinktank_expert.rb', line 22

def oss_profile_images
  @oss_profile_images
end

#person_typeObject

Returns the value of attribute person_type.



28
29
30
# File 'lib/models/thinktank_expert.rb', line 28

def person_type
  @person_type
end

#phoneObject

Returns the value of attribute phone.



9
10
11
# File 'lib/models/thinktank_expert.rb', line 9

def phone
  @phone
end

#profile_imagesObject

Returns the value of attribute profile_images.



8
9
10
# File 'lib/models/thinktank_expert.rb', line 8

def profile_images
  @profile_images
end

Returns the value of attribute related_topics.



15
16
17
# File 'lib/models/thinktank_expert.rb', line 15

def related_topics
  @related_topics
end

#site_nameObject

Returns the value of attribute site_name.



16
17
18
# File 'lib/models/thinktank_expert.rb', line 16

def site_name
  @site_name
end

#site_name_cnObject

Returns the value of attribute site_name_cn.



17
18
19
# File 'lib/models/thinktank_expert.rb', line 17

def site_name_cn
  @site_name_cn
end

#sourceObject

Returns the value of attribute source.



21
22
23
# File 'lib/models/thinktank_expert.rb', line 21

def source
  @source
end

#titleObject

Returns the value of attribute title.



4
5
6
# File 'lib/models/thinktank_expert.rb', line 4

def title
  @title
end

#twitterObject

Returns the value of attribute twitter.



24
25
26
# File 'lib/models/thinktank_expert.rb', line 24

def twitter
  @twitter
end

#updated_atObject

Returns the value of attribute updated_at.



20
21
22
# File 'lib/models/thinktank_expert.rb', line 20

def updated_at
  @updated_at
end

#videosObject

Returns the value of attribute videos.



13
14
15
# File 'lib/models/thinktank_expert.rb', line 13

def videos
  @videos
end

#websiteObject

Returns the value of attribute website.



33
34
35
# File 'lib/models/thinktank_expert.rb', line 33

def website
  @website
end

#wikidataObject

Returns the value of attribute wikidata.



27
28
29
# File 'lib/models/thinktank_expert.rb', line 27

def wikidata
  @wikidata
end

Class Method Details

.table_nameObject



37
38
39
# File 'lib/models/thinktank_expert.rb', line 37

def self.table_name
	return "thinktank_experts"
end

.verify_keysObject



122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/models/thinktank_expert.rb', line 122

def self.verify_keys
	return {
		"id"=>          ["empty", "string"],
		"title"=>       ["json", "string"],
		"name"=>        ["empty", "string"],
		"site_name_cn"=>["empty", "string"],
		"site_name"=>   ["empty", "string"],
		"source"=>      ["empty", "string"],
		"audios"=>      ["json", "string"],
		"videos"=>      ["json", "string"],
		"related_topics"=>["json", "string"],
		"files"=>       ["json", "string"],
		"oss_files"=>   ["json", "string"],
		"domain"=>      ["empty", "string"],
		"created_at"=>  ["empty", "int", "length:13"],
		"updated_at"=>  ["empty", "int", "length:13"],		
		"area_of_expertise" => ["json", "string"],	
	}
end

Instance Method Details

#as_jsonObject



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/models/thinktank_expert.rb', line 80

def as_json
	return {
		id: @id,
		name: @name,
		title: @title,
		content: @content,
		location: @location,
		area_of_expertise: @area_of_expertise,
		profile_images: @profile_images,
		phone: @phone,
		email: @email,
		link: @link,
		audios: @audios,
		videos: @videos,
		education: @education,
		related_topics: @related_topics,
		site_name: @site_name,
		site_name_cn: @site_name_cn,
		domain: @domain,
		created_at: @created_at,
		updated_at: @updated_at,
		source: @source,
		oss_profile_images: @oss_profile_images,
		facebook: @facebook,
		twitter: @twitter,
		linkedin: @linkedin,
		instagram: @instagram,
		wikidata: @wikidata,
		person_type: @person_type,
		files: @files,
		oss_files: @oss_files,
		associated_program: @associated_program,
		lang: @lang,
		website: @website,
		nationalities: @nationalities,
	}
end

#to_jsonObject



118
119
120
# File 'lib/models/thinktank_expert.rb', line 118

def to_json
	return as_json.to_json
end