Class: ATProto::Writes::Collector
- Inherits:
-
Object
- Object
- ATProto::Writes::Collector
show all
- Extended by:
- T::Sig
- Includes:
- RequestUtils
- Defined in:
- lib/at_protocol/writes.rb
Instance Method Summary
collapse
at_uri, #create_session_uri, #default_authenticated_headers, #default_headers, #delete_record_uri, #delete_session_uri, #get_paginated_data, #get_post_thread_uri, #get_session_uri, #mute_actor_uri, #query_obj_to_query_params, #refresh_session_uri, #refresh_token_headers, #resolve_handle, #upload_blob_uri
Constructor Details
Returns a new instance of Collector.
117
118
119
|
# File 'lib/at_protocol/writes.rb', line 117
def initialize
@writes = []
end
|
Instance Method Details
#create(hash) ⇒ Object
123
124
125
126
127
128
129
|
# File 'lib/at_protocol/writes.rb', line 123
def create(hash)
@writes << Write.new({
action: Write::Action::Create,
value: hash,
collection: hash["$type"] || hash[:"$type"],
})
end
|
#delete(uri) ⇒ Object
145
146
147
148
149
150
151
152
|
# File 'lib/at_protocol/writes.rb', line 145
def delete(uri)
aturi = at_uri(uri)
@writes << Write.new({
action: Write::Action::Delete,
collection: T.must(aturi).collection.to_s,
rkey: T.must(aturi).rkey,
})
end
|
#update(uri, hash) ⇒ Object
133
134
135
136
137
138
139
140
141
|
# File 'lib/at_protocol/writes.rb', line 133
def update(uri, hash)
aturi = at_uri(uri)
@writes << Write.new({
action: Write::Action::Update,
value: hash,
collection: T.must(aturi).collection.to_s,
rkey: T.must(aturi).rkey,
})
end
|