Class: ThinktankReport
- Defined in:
- lib/models/thinktank_report.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.
-
#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.
-
#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 = {}) ⇒ ThinktankReport
constructor
A new instance of ThinktankReport.
- #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 = {}) ⇒ ThinktankReport
Returns a new instance of ThinktankReport.
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 79 80 81 82 83 |
# File 'lib/models/thinktank_report.rb', line 45 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"] @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"] end |
Instance Attribute Details
#abstract ⇒ Object
Returns the value of attribute abstract.
6 7 8 |
# File 'lib/models/thinktank_report.rb', line 6 def abstract @abstract end |
#audios ⇒ Object
Returns the value of attribute audios.
13 14 15 |
# File 'lib/models/thinktank_report.rb', line 13 def audios @audios end |
#author_names ⇒ Object
Returns the value of attribute author_names.
8 9 10 |
# File 'lib/models/thinktank_report.rb', line 8 def @author_names end |
#authors ⇒ Object
Returns the value of attribute authors.
34 35 36 |
# File 'lib/models/thinktank_report.rb', line 34 def @authors end |
#category ⇒ Object
Returns the value of attribute category.
27 28 29 |
# File 'lib/models/thinktank_report.rb', line 27 def category @category end |
#comments ⇒ Object
Returns the value of attribute comments.
31 32 33 |
# File 'lib/models/thinktank_report.rb', line 31 def comments @comments end |
#content ⇒ Object
Returns the value of attribute content.
7 8 9 |
# File 'lib/models/thinktank_report.rb', line 7 def content @content end |
#country_cn ⇒ Object
Returns the value of attribute country_cn.
19 20 21 |
# File 'lib/models/thinktank_report.rb', line 19 def country_cn @country_cn end |
#country_code ⇒ Object
Returns the value of attribute country_code.
20 21 22 |
# File 'lib/models/thinktank_report.rb', line 20 def country_code @country_code end |
#created_at ⇒ Object
Returns the value of attribute created_at.
21 22 23 |
# File 'lib/models/thinktank_report.rb', line 21 def created_at @created_at end |
#created_time ⇒ Object
Returns the value of attribute created_time.
23 24 25 |
# File 'lib/models/thinktank_report.rb', line 23 def created_time @created_time end |
#customer_category ⇒ Object
Returns the value of attribute customer_category.
26 27 28 |
# File 'lib/models/thinktank_report.rb', line 26 def customer_category @customer_category end |
#domain ⇒ Object
Returns the value of attribute domain.
15 16 17 |
# File 'lib/models/thinktank_report.rb', line 15 def domain @domain end |
#files ⇒ Object
Returns the value of attribute files.
10 11 12 |
# File 'lib/models/thinktank_report.rb', line 10 def files @files end |
#html_content ⇒ Object
Returns the value of attribute html_content.
17 18 19 |
# File 'lib/models/thinktank_report.rb', line 17 def html_content @html_content end |
#id ⇒ Object
Returns the value of attribute id.
2 3 4 |
# File 'lib/models/thinktank_report.rb', line 2 def id @id end |
#images ⇒ Object
Returns the value of attribute images.
11 12 13 |
# File 'lib/models/thinktank_report.rb', line 11 def images @images end |
#keywords ⇒ Object
Returns the value of attribute keywords.
16 17 18 |
# File 'lib/models/thinktank_report.rb', line 16 def keywords @keywords end |
#lang ⇒ Object
Returns the value of attribute lang.
18 19 20 |
# File 'lib/models/thinktank_report.rb', line 18 def lang @lang end |
#links ⇒ Object
Returns the value of attribute links.
14 15 16 |
# File 'lib/models/thinktank_report.rb', line 14 def links @links end |
#mention_country ⇒ Object
Returns the value of attribute mention_country.
33 34 35 |
# File 'lib/models/thinktank_report.rb', line 33 def mention_country @mention_country end |
#oss_files ⇒ Object
Returns the value of attribute oss_files.
24 25 26 |
# File 'lib/models/thinktank_report.rb', line 24 def oss_files @oss_files end |
#oss_images ⇒ Object
Returns the value of attribute oss_images.
25 26 27 |
# File 'lib/models/thinktank_report.rb', line 25 def oss_images @oss_images end |
#reference ⇒ Object
Returns the value of attribute reference.
32 33 34 |
# File 'lib/models/thinktank_report.rb', line 32 def reference @reference end |
#site_name ⇒ Object
Returns the value of attribute site_name.
4 5 6 |
# File 'lib/models/thinktank_report.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_report.rb', line 5 def site_name_cn @site_name_cn end |
#source ⇒ Object
Returns the value of attribute source.
9 10 11 |
# File 'lib/models/thinktank_report.rb', line 9 def source @source end |
#sub_title ⇒ Object
Returns the value of attribute sub_title.
35 36 37 |
# File 'lib/models/thinktank_report.rb', line 35 def sub_title @sub_title end |
#tags ⇒ Object
Returns the value of attribute tags.
29 30 31 |
# File 'lib/models/thinktank_report.rb', line 29 def @tags end |
#timezone ⇒ Object
Returns the value of attribute timezone.
36 37 38 |
# File 'lib/models/thinktank_report.rb', line 36 def timezone @timezone end |
#timezone_location ⇒ Object
Returns the value of attribute timezone_location.
37 38 39 |
# File 'lib/models/thinktank_report.rb', line 37 def timezone_location @timezone_location end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/models/thinktank_report.rb', line 3 def title @title end |
#topics ⇒ Object
Returns the value of attribute topics.
28 29 30 |
# File 'lib/models/thinktank_report.rb', line 28 def topics @topics end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
22 23 24 |
# File 'lib/models/thinktank_report.rb', line 22 def updated_at @updated_at end |
#videos ⇒ Object
Returns the value of attribute videos.
12 13 14 |
# File 'lib/models/thinktank_report.rb', line 12 def videos @videos end |
#views ⇒ Object
Returns the value of attribute views.
30 31 32 |
# File 'lib/models/thinktank_report.rb', line 30 def views @views end |
Class Method Details
.table_name ⇒ Object
39 40 41 |
# File 'lib/models/thinktank_report.rb', line 39 def self.table_name return "thinktank_reports" end |
.verify_keys ⇒ Object
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/models/thinktank_report.rb', line 130 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"], } end |
Instance Method Details
#as_json ⇒ Object
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 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/models/thinktank_report.rb', line 89 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, 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 } end |
#to_json ⇒ Object
85 86 87 |
# File 'lib/models/thinktank_report.rb', line 85 def to_json return as_json.to_json end |