Class: Ghee::API::Repos::Contents::Proxy
- Inherits:
-
ResourceProxy
- Object
- ResourceProxy
- Ghee::API::Repos::Contents::Proxy
- Defined in:
- lib/ghee/api/contents.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
Attributes inherited from ResourceProxy
#connection, #current_page, #id, #pagination, #params, #path_prefix, #total
Instance Method Summary collapse
Methods inherited from ResourceProxy
accept_header, #all, #all_parallel, #build_prefix, #initialize, #method_missing, #paginate, #raw, #subject
Methods included from CUD
Constructor Details
This class inherits a constructor from Ghee::ResourceProxy
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Ghee::ResourceProxy
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
17 18 19 |
# File 'lib/ghee/api/contents.rb', line 17 def path @path end |
Instance Method Details
#create(message, content = nil) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/ghee/api/contents.rb', line 18 def create(, content=nil) if content.nil? .inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo} attributes = { path: path }.merge attributes[:content] = Base64.encode64 attributes[:content] else attributes = { path: path, message: , content: Base64.encode64(content) } end connection.put(path_prefix, attributes).body end |