Class: InfomemeClient::EntityHash::Meme
Instance Method Summary
collapse
#freeze, #id, #method_missing, #respond_to?, #to_hash
Constructor Details
#initialize(meme, client) ⇒ Meme
Returns a new instance of Meme.
2
3
4
5
6
|
# File 'lib/infomeme_client/entity_hash/meme.rb', line 2
def initialize(meme, client)
super(meme, true)
@client = client
freeze
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class InfomemeClient::EntityHash
Instance Method Details
#activate ⇒ Object
22
23
24
|
# File 'lib/infomeme_client/entity_hash/meme.rb', line 22
def activate
@client.activate_meme(id)
end
|
46
47
48
|
# File 'lib/infomeme_client/entity_hash/meme.rb', line 46
def ()
@client.(id, )
end
|
#confirm ⇒ Object
18
19
20
|
# File 'lib/infomeme_client/entity_hash/meme.rb', line 18
def confirm
@client.confirm_meme(id)
end
|
#deactivate ⇒ Object
26
27
28
|
# File 'lib/infomeme_client/entity_hash/meme.rb', line 26
def deactivate
@client.deactivate_meme(id)
end
|
#delete ⇒ Object
14
15
16
|
# File 'lib/infomeme_client/entity_hash/meme.rb', line 14
def delete
@client.delete_meme(id)
end
|
#rate(rating) ⇒ Object
42
43
44
|
# File 'lib/infomeme_client/entity_hash/meme.rb', line 42
def rate(rating)
@client.rate(id, rating)
end
|
#review(reveiw) ⇒ Object
38
39
40
|
# File 'lib/infomeme_client/entity_hash/meme.rb', line 38
def review(reveiw)
@client.review id, review
end
|
#update(options = {}) ⇒ Object
todo: have_access?, published_by_me?, confirmed?, inactive?, incomplete?, has_upload?, etc.
10
11
12
|
# File 'lib/infomeme_client/entity_hash/meme.rb', line 10
def update(options = {})
@client.update_meme(id, options)
end
|
#upload(file) ⇒ Object
34
35
36
|
# File 'lib/infomeme_client/entity_hash/meme.rb', line 34
def upload(file)
@client.upload(id, file)
end
|
#upload_url(raw = false) ⇒ Object
30
31
32
|
# File 'lib/infomeme_client/entity_hash/meme.rb', line 30
def upload_url(raw = false)
@client.upload_for_meme(id, raw)
end
|