Class: E621ExportDownloader::Models::BulkUpdateRequest

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/e621_export_downloader/models/bulk_update_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(record) ⇒ BulkUpdateRequest

Returns a new instance of BulkUpdateRequest.



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/e621_export_downloader/models/bulk_update_request.rb', line 46

def initialize(record)
  @record         = T.let(record, T::Hash[String, String])
  @approver_id    = T.let(T.must(record["approver_id"]).empty? ? nil : record["approver_id"].to_i, T.nilable(Integer))
  @created_at     = T.let(DateTime.parse(record["created_at"]), DateTime)
  @down_votes     = T.let(record["down_votes"].to_i, Integer)
  @forum_topic_id = T.let(T.must(record["forum_topic_id"]).empty? ? nil : record["forum_topic_id"].to_i, T.nilable(Integer))
  @id             = T.let(record["id"].to_i, Integer)
  @meh_votes      = T.let(record["meh_votes"].to_i, Integer)
  @script         = T.let(T.must(record["script"]), String)
  @status         = T.let(T.must(record["status"]), String)
  @title          = T.let(T.must(record["title"]).empty? ? nil : record["title"], T.nilable(String))
  @up_votes       = T.let(record["up_votes"].to_i, Integer)
  @updated_at     = T.let(DateTime.parse(record["updated_at"]), DateTime)
  @user_id        = T.let(record["user_id"].to_i, Integer)
end

Instance Attribute Details

#approver_idObject (readonly)

Returns the value of attribute approver_id.



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

def approver_id
  @approver_id
end

#created_atObject (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#down_votesObject (readonly)

Returns the value of attribute down_votes.



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

def down_votes
  @down_votes
end

#forum_topic_idObject (readonly)

Returns the value of attribute forum_topic_id.



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

def forum_topic_id
  @forum_topic_id
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#meh_votesObject (readonly)

Returns the value of attribute meh_votes.



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

def meh_votes
  @meh_votes
end

#scriptObject (readonly)

Returns the value of attribute script.



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

def script
  @script
end

#statusObject (readonly)

Returns the value of attribute status.



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

def status
  @status
end

#titleObject (readonly)

Returns the value of attribute title.



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

def title
  @title
end

#up_votesObject (readonly)

Returns the value of attribute up_votes.



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

def up_votes
  @up_votes
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



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

def updated_at
  @updated_at
end

#user_idObject (readonly)

Returns the value of attribute user_id.



43
44
45
# File 'lib/e621_export_downloader/models/bulk_update_request.rb', line 43

def user_id
  @user_id
end

Instance Method Details

#to_json(*_args) ⇒ Object



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/e621_export_downloader/models/bulk_update_request.rb', line 63

def to_json(*_args)
  {
    approver_id:    @approver_id,
    created_at:     @created_at,
    down_votes:     @down_votes,
    forum_topic_id: @forum_topic_id,
    id:             @id,
    meh_votes:      @meh_votes,
    script:         @script,
    status:         @status,
    title:          @title,
    up_votes:       @up_votes,
    updated_at:     @updated_at,
    user_id:        @user_id,
  }.to_json
end