Class: Cheatly::Adapter::GitHub
- Inherits:
-
Object
- Object
- Cheatly::Adapter::GitHub
- Defined in:
- lib/cheatly/adapter/github.rb
Constant Summary collapse
- FOLDER =
'sheets'- REPO =
'arthurnn/cheatly'
Instance Method Summary collapse
Instance Method Details
#all ⇒ Object
15 16 17 18 |
# File 'lib/cheatly/adapter/github.rb', line 15 def all response = Octokit.contents(REPO, path: "#{FOLDER}") response.map { |f| f.name.gsub(/\.[a-z]+\z/, '') } end |
#create(name, body) ⇒ Object
20 21 22 |
# File 'lib/cheatly/adapter/github.rb', line 20 def create(name, body) raise NotImplementedError end |
#find(path) ⇒ Object
10 11 12 13 |
# File 'lib/cheatly/adapter/github.rb', line 10 def find(path) response = Octokit.contents(REPO, path: "#{FOLDER}/#{path}.md") Base64.decode64(response.content) end |
#update(name, body) ⇒ Object
24 25 26 |
# File 'lib/cheatly/adapter/github.rb', line 24 def update(name, body) raise NotImplementedError end |