Class: ThinktankInformation
- Defined in:
- lib/models/thinktank_information.rb
Instance Attribute Summary collapse
-
#abstract ⇒ Object
Returns the value of attribute abstract.
-
#audios ⇒ Object
Returns the value of attribute audios.
-
#author_names ⇒ Object
Returns the value of attribute author_names.
-
#authors ⇒ Object
Returns the value of attribute authors.
-
#category ⇒ Object
Returns the value of attribute category.
-
#comments ⇒ Object
Returns the value of attribute comments.
-
#content ⇒ Object
Returns the value of attribute content.
-
#country_cn ⇒ Object
Returns the value of attribute country_cn.
-
#country_code ⇒ Object
Returns the value of attribute country_code.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#created_time ⇒ Object
Returns the value of attribute created_time.
-
#customer_category ⇒ Object
Returns the value of attribute customer_category.
-
#domain ⇒ Object
Returns the value of attribute domain.
-
#files ⇒ Object
Returns the value of attribute files.
-
#html_content ⇒ Object
Returns the value of attribute html_content.
-
#id ⇒ Object
Returns the value of attribute id.
-
#images ⇒ Object
Returns the value of attribute images.
-
#keywords ⇒ Object
Returns the value of attribute keywords.
-
#lang ⇒ Object
Returns the value of attribute lang.
-
#links ⇒ Object
Returns the value of attribute links.
-
#mention_country ⇒ Object
Returns the value of attribute mention_country.
-
#oss_files ⇒ Object
Returns the value of attribute oss_files.
-
#oss_images ⇒ Object
Returns the value of attribute oss_images.
-
#reference ⇒ Object
Returns the value of attribute reference.
-
#related_author_names ⇒ Object
Returns the value of attribute related_author_names.
-
#related_authors ⇒ Object
Returns the value of attribute related_authors.
-
#site_name ⇒ Object
Returns the value of attribute site_name.
-
#site_name_cn ⇒ Object
Returns the value of attribute site_name_cn.
-
#source ⇒ Object
Returns the value of attribute source.
-
#state_info ⇒ Object
Returns the value of attribute state_info.
-
#sub_title ⇒ Object
Returns the value of attribute sub_title.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#timezone ⇒ Object
Returns the value of attribute timezone.
-
#timezone_location ⇒ Object
Returns the value of attribute timezone_location.
-
#title ⇒ Object
Returns the value of attribute title.
-
#topics ⇒ Object
Returns the value of attribute topics.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
-
#videos ⇒ Object
Returns the value of attribute videos.
-
#views ⇒ Object
Returns the value of attribute views.
Class Method Summary collapse
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(options = {}) ⇒ ThinktankInformation
constructor
A new instance of ThinktankInformation.
- #to_json ⇒ Object
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(={}) = JSON.parse(.to_json) @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 |
Instance Attribute Details
#abstract ⇒ Object
Returns the value of attribute abstract.
6 7 8 |
# File 'lib/models/thinktank_information.rb', line 6 def abstract @abstract end |
#audios ⇒ Object
Returns the value of attribute audios.
14 15 16 |
# File 'lib/models/thinktank_information.rb', line 14 def audios @audios end |
#author_names ⇒ Object
Returns the value of attribute author_names.
8 9 10 |
# File 'lib/models/thinktank_information.rb', line 8 def @author_names end |
#authors ⇒ Object
Returns the value of attribute authors.
35 36 37 |
# File 'lib/models/thinktank_information.rb', line 35 def @authors end |
#category ⇒ Object
Returns the value of attribute category.
28 29 30 |
# File 'lib/models/thinktank_information.rb', line 28 def category @category end |
#comments ⇒ Object
Returns the value of attribute comments.
32 33 34 |
# File 'lib/models/thinktank_information.rb', line 32 def comments @comments end |
#content ⇒ Object
Returns the value of attribute content.
7 8 9 |
# File 'lib/models/thinktank_information.rb', line 7 def content @content end |
#country_cn ⇒ Object
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_code ⇒ Object
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_at ⇒ Object
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_time ⇒ Object
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_category ⇒ Object
Returns the value of attribute customer_category.
27 28 29 |
# File 'lib/models/thinktank_information.rb', line 27 def customer_category @customer_category end |
#domain ⇒ Object
Returns the value of attribute domain.
16 17 18 |
# File 'lib/models/thinktank_information.rb', line 16 def domain @domain end |
#files ⇒ Object
Returns the value of attribute files.
11 12 13 |
# File 'lib/models/thinktank_information.rb', line 11 def files @files end |
#html_content ⇒ Object
Returns the value of attribute html_content.
18 19 20 |
# File 'lib/models/thinktank_information.rb', line 18 def html_content @html_content end |
#id ⇒ Object
Returns the value of attribute id.
2 3 4 |
# File 'lib/models/thinktank_information.rb', line 2 def id @id end |
#images ⇒ Object
Returns the value of attribute images.
12 13 14 |
# File 'lib/models/thinktank_information.rb', line 12 def images @images end |
#keywords ⇒ Object
Returns the value of attribute keywords.
17 18 19 |
# File 'lib/models/thinktank_information.rb', line 17 def keywords @keywords end |
#lang ⇒ Object
Returns the value of attribute lang.
19 20 21 |
# File 'lib/models/thinktank_information.rb', line 19 def lang @lang end |
#links ⇒ Object
Returns the value of attribute links.
15 16 17 |
# File 'lib/models/thinktank_information.rb', line 15 def links @links end |
#mention_country ⇒ Object
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_files ⇒ Object
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_images ⇒ Object
Returns the value of attribute oss_images.
26 27 28 |
# File 'lib/models/thinktank_information.rb', line 26 def oss_images @oss_images end |
#reference ⇒ Object
Returns the value of attribute reference.
33 34 35 |
# File 'lib/models/thinktank_information.rb', line 33 def reference @reference end |
#related_author_names ⇒ Object
Returns the value of attribute related_author_names.
40 41 42 |
# File 'lib/models/thinktank_information.rb', line 40 def @related_author_names end |
#related_authors ⇒ Object
Returns the value of attribute related_authors.
39 40 41 |
# File 'lib/models/thinktank_information.rb', line 39 def @related_authors end |
#site_name ⇒ Object
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_cn ⇒ Object
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 |
#source ⇒ Object
Returns the value of attribute source.
10 11 12 |
# File 'lib/models/thinktank_information.rb', line 10 def source @source end |
#state_info ⇒ Object
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_title ⇒ Object
Returns the value of attribute sub_title.
36 37 38 |
# File 'lib/models/thinktank_information.rb', line 36 def sub_title @sub_title end |
#tags ⇒ Object
Returns the value of attribute tags.
30 31 32 |
# File 'lib/models/thinktank_information.rb', line 30 def @tags end |
#timezone ⇒ Object
Returns the value of attribute timezone.
37 38 39 |
# File 'lib/models/thinktank_information.rb', line 37 def timezone @timezone end |
#timezone_location ⇒ Object
Returns the value of attribute timezone_location.
38 39 40 |
# File 'lib/models/thinktank_information.rb', line 38 def timezone_location @timezone_location end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/models/thinktank_information.rb', line 3 def title @title end |
#topics ⇒ Object
Returns the value of attribute topics.
29 30 31 |
# File 'lib/models/thinktank_information.rb', line 29 def topics @topics end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
23 24 25 |
# File 'lib/models/thinktank_information.rb', line 23 def updated_at @updated_at end |
#videos ⇒ Object
Returns the value of attribute videos.
13 14 15 |
# File 'lib/models/thinktank_information.rb', line 13 def videos @videos end |
#views ⇒ Object
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_name ⇒ Object
42 43 44 |
# File 'lib/models/thinktank_information.rb', line 42 def self.table_name return "thinktank_informations" end |
.verify_keys ⇒ Object
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_json ⇒ Object
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_json ⇒ Object
136 137 138 |
# File 'lib/models/thinktank_information.rb', line 136 def to_json return as_json.to_json end |