Class: ThinktankInformation

Inherits:
BaseModel show all
Defined in:
lib/models/thinktank_information.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 = {}) ⇒ ThinktankInformation

Returns a new instance of ThinktankInformation.



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
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/models/thinktank_information.rb', line 48

def initialize(options={})
	options = JSON.parse(options.to_json)
	@id = options["id"]
	@title = options["title"]
	@site_name = options["site_name"]
	@site_name_cn = options["site_name_cn"]
	@abstract = options["abstract"]
	@content = options["content"]
	@author_names = options["author_names"]
	@state_info = options["state_info"]
	@source = options["source"]
	@files = options["files"]
	@images = options["images"]
	@videos = options["videos"]
	@audios = options["audios"]
	@links = options["links"]
	@domain = options["domain"]
	@keywords = options["keywords"]
	@html_content = options["html_content"]
	@lang = options["lang"]
	@country_cn = options["country_cn"]
	@country_code = options["country_code"]
	@created_at = options["created_at"]
	@updated_at = options["updated_at"]
	@created_time = options["created_time"]
	@oss_files = options["oss_files"]
	@oss_images = options["oss_images"]
	@customer_category = options["customer_category"]
	@category = options["category"]
	@topics = options["topics"]
	@tags = options["tags"]
	@views = options["views"]
	@comments = options["comments"]
	@reference = options["reference"]
	@mention_country = options["mention_country"]
	@authors = options["authors"]
	@sub_title = options["sub_title"]
	@timezone = options["timezone"]
	@timezone_location = options["timezone_location"]
	@related_authors = options["related_authors"]
	@related_author_names = options["related_author_names"]		
end

Instance Attribute Details

#abstractObject

Returns the value of attribute abstract.



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

def abstract
  @abstract
end

#audiosObject

Returns the value of attribute audios.



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

def audios
  @audios
end

#author_namesObject

Returns the value of attribute author_names.



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

def author_names
  @author_names
end

#authorsObject

Returns the value of attribute authors.



35
36
37
# File 'lib/models/thinktank_information.rb', line 35

def authors
  @authors
end

#categoryObject

Returns the value of attribute category.



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

def category
  @category
end

#commentsObject

Returns the value of attribute comments.



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

def comments
  @comments
end

#contentObject

Returns the value of attribute content.



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

def content
  @content
end

#country_cnObject

Returns the value of attribute country_cn.



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

def country_cn
  @country_cn
end

#country_codeObject

Returns the value of attribute country_code.



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

def country_code
  @country_code
end

#created_atObject

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#created_timeObject

Returns the value of attribute created_time.



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

def created_time
  @created_time
end

#customer_categoryObject

Returns the value of attribute customer_category.



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

def customer_category
  @customer_category
end

#domainObject

Returns the value of attribute domain.



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

def domain
  @domain
end

#filesObject

Returns the value of attribute files.



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

def files
  @files
end

#html_contentObject

Returns the value of attribute html_content.



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

def html_content
  @html_content
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#imagesObject

Returns the value of attribute images.



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

def images
  @images
end

#keywordsObject

Returns the value of attribute keywords.



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

def keywords
  @keywords
end

#langObject

Returns the value of attribute lang.



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

def lang
  @lang
end

Returns the value of attribute links.



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

def links
  @links
end

#mention_countryObject

Returns the value of attribute mention_country.



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

def mention_country
  @mention_country
end

#oss_filesObject

Returns the value of attribute oss_files.



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

def oss_files
  @oss_files
end

#oss_imagesObject

Returns the value of attribute oss_images.



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

def oss_images
  @oss_images
end

#referenceObject

Returns the value of attribute reference.



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

def reference
  @reference
end

Returns the value of attribute related_author_names.



40
41
42
# File 'lib/models/thinktank_information.rb', line 40

def related_author_names
  @related_author_names
end

Returns the value of attribute related_authors.



39
40
41
# File 'lib/models/thinktank_information.rb', line 39

def related_authors
  @related_authors
end

#site_nameObject

Returns the value of attribute site_name.



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

def site_name
  @site_name
end

#site_name_cnObject

Returns the value of attribute site_name_cn.



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

def site_name_cn
  @site_name_cn
end

#sourceObject

Returns the value of attribute source.



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

def source
  @source
end

#state_infoObject

Returns the value of attribute state_info.



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

def state_info
  @state_info
end

#sub_titleObject

Returns the value of attribute sub_title.



36
37
38
# File 'lib/models/thinktank_information.rb', line 36

def sub_title
  @sub_title
end

#tagsObject

Returns the value of attribute tags.



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

def tags
  @tags
end

#timezoneObject

Returns the value of attribute timezone.



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

def timezone
  @timezone
end

#timezone_locationObject

Returns the value of attribute timezone_location.



38
39
40
# File 'lib/models/thinktank_information.rb', line 38

def timezone_location
  @timezone_location
end

#titleObject

Returns the value of attribute title.



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

def title
  @title
end

#topicsObject

Returns the value of attribute topics.



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

def topics
  @topics
end

#updated_atObject

Returns the value of attribute updated_at.



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

def updated_at
  @updated_at
end

#videosObject

Returns the value of attribute videos.



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

def videos
  @videos
end

#viewsObject

Returns the value of attribute views.



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

def views
  @views
end

Class Method Details

.table_nameObject



42
43
44
# File 'lib/models/thinktank_information.rb', line 42

def self.table_name
	return "thinktank_informations"
end

.verify_keysObject



140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/models/thinktank_information.rb', line 140

def self.verify_keys
	return {
		"id"=>            ["empty", "string"],
		"title"=>         ["empty", "string"],
		"site_name"=>     ["empty", "string"],
		"site_name_cn"=>  ["empty", "string"],
		"content"=>       ["empty", "string"],
		"source"=>        ["empty", "string"],
		"files"=>         ["json", "string"],
		"images"=>        ["json", "string"],
		"videos"=>        ["json", "string"],
		"audios"=>        ["json", "string"],
		"links"=>         ["json", "string"],
		"domain"=>        ["empty", "string"],
		"keywords"=>      ["json", "string"],
		"lang"=>          ["empty", "string"],
		"country_cn"=>    ["empty", "string"],
		"country_code"=>  ["empty", "string"],
		"created_at"=>    ["empty", "int", "length:13"],
		"updated_at"=>    ["empty", "int", "length:13"],
		"created_time"=>  ["empty", "int", "length:10"],
		"oss_files"=>     ["json", "string"],
		"oss_images"=>    ["json", "string"],
		"topics"=>        ["json", "string"],
		"tags"=>          ["string", "json"],
		"authors"=>       ["json", "fields:author_id,author_name,author_url", "string"],
		"timezone"=>      ["empty", 'regex:[\+|-]\d{4}', "string"],
		"timezone_location"=> ["empty", "string"],	
		"related_authors" => ["json","string"],
	}
end

Instance Method Details

#as_jsonObject



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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/models/thinktank_information.rb', line 91

def as_json
	return {
		id: @id,
		title: @title,
		site_name: @site_name,
		site_name_cn: @site_name_cn,
		abstract: @abstract,
		content: @content,
		author_names: @author_names,
		state_info: @state_info,
		source: @source,
		files: @files,
		images: @images,
		videos: @videos,
		audios: @audios,
		links: @links,
		domain: @domain,
		keywords: @keywords,
		html_content: @html_content,
		lang: @lang,
		country_cn: @country_cn,
		country_code: @country_code,
		created_at: @created_at,
		updated_at: @updated_at,
		created_time: @created_time,
		oss_files: @oss_files,
		oss_images: @oss_images,
		customer_category: @customer_category,
		category: @category,
		topics: @topics,
		tags: @tags,
		views: @views,
		comments: @comments,
		reference: @reference,
		mention_country: @mention_country,
		authors: @authors,
		sub_title: @sub_title,
		timezone: @timezone,
		timezone_location: @timezone_location,
		related_authors: @related_authors,
		related_author_names: @related_author_names,			

	}
end

#to_jsonObject



136
137
138
# File 'lib/models/thinktank_information.rb', line 136

def to_json
	return as_json.to_json
end