Class: E621ExportDownloader::Models::PostVersion
- Inherits:
-
Object
- Object
- E621ExportDownloader::Models::PostVersion
- Extended by:
- T::Sig
- Defined in:
- lib/e621_export_downloader/models/post_version.rb
Instance Attribute Summary collapse
-
#added_locked_tags ⇒ Object
readonly
Returns the value of attribute added_locked_tags.
-
#added_tags ⇒ Object
readonly
Returns the value of attribute added_tags.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#description_changed ⇒ Object
readonly
Returns the value of attribute description_changed.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#locked_tags ⇒ Object
readonly
Returns the value of attribute locked_tags.
-
#parent_changed ⇒ Object
readonly
Returns the value of attribute parent_changed.
-
#parent_id ⇒ Object
readonly
Returns the value of attribute parent_id.
-
#rating ⇒ Object
readonly
Returns the value of attribute rating.
-
#rating_changed ⇒ Object
readonly
Returns the value of attribute rating_changed.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
-
#removed_locked_tags ⇒ Object
readonly
Returns the value of attribute removed_locked_tags.
-
#removed_tags ⇒ Object
readonly
Returns the value of attribute removed_tags.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#source_changed ⇒ Object
readonly
Returns the value of attribute source_changed.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
-
#updater_id ⇒ Object
readonly
Returns the value of attribute updater_id.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(record) ⇒ PostVersion
constructor
A new instance of PostVersion.
- #to_json(*_args) ⇒ Object
Constructor Details
#initialize(record) ⇒ PostVersion
Returns a new instance of PostVersion.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/e621_export_downloader/models/post_version.rb', line 67 def initialize(record) @record = T.let(record, T::Hash[String, String]) inner = T.must(T.must(record["added_locked_tags"])[1..-2]) @added_locked_tags = T.let(inner.empty? ? [] : inner.split(","), T::Array[String]) inner = T.must(T.must(record["added_tags"])[1..-2]) @added_tags = T.let(inner.empty? ? [] : inner.split(","), T::Array[String]) @description = T.let(T.must(record["description"]).empty? ? nil : record["description"], T.nilable(String)) @description_changed = T.let(record["description_changed"] == "t", T::Boolean) @id = T.let(record["id"].to_i, Integer) @locked_tags = T.let(T.must(record["locked_tags"]).empty? ? nil : record["locked_tags"], T.nilable(String)) @parent_changed = T.let(record["parent_changed"] == "t", T::Boolean) @parent_id = T.let(T.must(record["parent_id"]).empty? ? nil : record["parent_id"].to_i, T.nilable(Integer)) @rating = T.let(T.must(record["rating"]).empty? ? nil : record["rating"], T.nilable(String)) @rating_changed = T.let(record["rating_changed"] == "t", T::Boolean) @reason = T.let(T.must(record["reason"]).empty? ? nil : record["reason"], T.nilable(String)) inner = T.must(T.must(record["removed_locked_tags"])[1..-2]) @removed_locked_tags = T.let(inner.empty? ? [] : inner.split(","), T::Array[String]) inner = T.must(T.must(record["removed_tags"])[1..-2]) @removed_tags = T.let(inner.empty? ? [] : inner.split(","), T::Array[String]) @source = T.let(T.must(record["source"]).empty? ? nil : record["source"], T.nilable(String)) @source_changed = T.let(record["source_changed"] == "t", T::Boolean) @tags = T.let(T.must(record["tags"]).empty? ? nil : record["tags"], T.nilable(String)) @updated_at = T.let(DateTime.parse(record["updated_at"]), DateTime) @updater_id = T.let(record["updater_id"].to_i, Integer) @version = T.let(record["version"].to_i, Integer) end |
Instance Attribute Details
#added_locked_tags ⇒ Object (readonly)
Returns the value of attribute added_locked_tags.
10 11 12 |
# File 'lib/e621_export_downloader/models/post_version.rb', line 10 def @added_locked_tags end |
#added_tags ⇒ Object (readonly)
Returns the value of attribute added_tags.
13 14 15 |
# File 'lib/e621_export_downloader/models/post_version.rb', line 13 def @added_tags end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
16 17 18 |
# File 'lib/e621_export_downloader/models/post_version.rb', line 16 def description @description end |
#description_changed ⇒ Object (readonly)
Returns the value of attribute description_changed.
19 20 21 |
# File 'lib/e621_export_downloader/models/post_version.rb', line 19 def description_changed @description_changed end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
22 23 24 |
# File 'lib/e621_export_downloader/models/post_version.rb', line 22 def id @id end |
#locked_tags ⇒ Object (readonly)
Returns the value of attribute locked_tags.
25 26 27 |
# File 'lib/e621_export_downloader/models/post_version.rb', line 25 def @locked_tags end |
#parent_changed ⇒ Object (readonly)
Returns the value of attribute parent_changed.
28 29 30 |
# File 'lib/e621_export_downloader/models/post_version.rb', line 28 def parent_changed @parent_changed end |
#parent_id ⇒ Object (readonly)
Returns the value of attribute parent_id.
31 32 33 |
# File 'lib/e621_export_downloader/models/post_version.rb', line 31 def parent_id @parent_id end |
#rating ⇒ Object (readonly)
Returns the value of attribute rating.
34 35 36 |
# File 'lib/e621_export_downloader/models/post_version.rb', line 34 def @rating end |
#rating_changed ⇒ Object (readonly)
Returns the value of attribute rating_changed.
37 38 39 |
# File 'lib/e621_export_downloader/models/post_version.rb', line 37 def @rating_changed end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
40 41 42 |
# File 'lib/e621_export_downloader/models/post_version.rb', line 40 def reason @reason end |
#removed_locked_tags ⇒ Object (readonly)
Returns the value of attribute removed_locked_tags.
43 44 45 |
# File 'lib/e621_export_downloader/models/post_version.rb', line 43 def @removed_locked_tags end |
#removed_tags ⇒ Object (readonly)
Returns the value of attribute removed_tags.
46 47 48 |
# File 'lib/e621_export_downloader/models/post_version.rb', line 46 def @removed_tags end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
49 50 51 |
# File 'lib/e621_export_downloader/models/post_version.rb', line 49 def source @source end |
#source_changed ⇒ Object (readonly)
Returns the value of attribute source_changed.
52 53 54 |
# File 'lib/e621_export_downloader/models/post_version.rb', line 52 def source_changed @source_changed end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
55 56 57 |
# File 'lib/e621_export_downloader/models/post_version.rb', line 55 def @tags end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
58 59 60 |
# File 'lib/e621_export_downloader/models/post_version.rb', line 58 def updated_at @updated_at end |
#updater_id ⇒ Object (readonly)
Returns the value of attribute updater_id.
61 62 63 |
# File 'lib/e621_export_downloader/models/post_version.rb', line 61 def updater_id @updater_id end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
64 65 66 |
# File 'lib/e621_export_downloader/models/post_version.rb', line 64 def version @version end |
Instance Method Details
#to_json(*_args) ⇒ Object
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/e621_export_downloader/models/post_version.rb', line 95 def to_json(*_args) { added_locked_tags: @added_locked_tags, added_tags: @added_tags, description: @description, description_changed: @description_changed, id: @id, locked_tags: @locked_tags, parent_changed: @parent_changed, parent_id: @parent_id, rating: @rating, rating_changed: @rating_changed, reason: @reason, removed_locked_tags: @removed_locked_tags, removed_tags: @removed_tags, source: @source, source_changed: @source_changed, tags: @tags, updated_at: @updated_at, updater_id: @updater_id, version: @version, }.to_json end |