Class: Mushikago::Mitsubachi::Resource
- Inherits:
-
Object
- Object
- Mushikago::Mitsubachi::Resource
- Defined in:
- lib/mushikago/mitsubachi/resource.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#project_name ⇒ Object
readonly
Returns the value of attribute project_name.
-
#resource_name ⇒ Object
readonly
Returns the value of attribute resource_name.
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(client, project_name, resource_name) ⇒ Resource
constructor
A new instance of Resource.
- #push(url, script_name, file_key, options = {}) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(client, project_name, resource_name) ⇒ Resource
Returns a new instance of Resource.
9 10 11 12 13 |
# File 'lib/mushikago/mitsubachi/resource.rb', line 9 def initialize client, project_name, resource_name @client = client @project_name = project_name @resource_name = resource_name end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
5 6 7 |
# File 'lib/mushikago/mitsubachi/resource.rb', line 5 def client @client end |
#project_name ⇒ Object (readonly)
Returns the value of attribute project_name.
6 7 8 |
# File 'lib/mushikago/mitsubachi/resource.rb', line 6 def project_name @project_name end |
#resource_name ⇒ Object (readonly)
Returns the value of attribute resource_name.
7 8 9 |
# File 'lib/mushikago/mitsubachi/resource.rb', line 7 def resource_name @resource_name end |
Instance Method Details
#body ⇒ Object
15 16 17 |
# File 'lib/mushikago/mitsubachi/resource.rb', line 15 def body client.resource_get(project_name, resource_name, :with_body => true)['body'] end |
#push(url, script_name, file_key, options = {}) ⇒ Object
19 20 21 |
# File 'lib/mushikago/mitsubachi/resource.rb', line 19 def push url, script_name, file_key, ={} client.http_push(project_name, url, script_name, resource_name, file_key, ) end |
#to_s ⇒ Object
23 24 25 |
# File 'lib/mushikago/mitsubachi/resource.rb', line 23 def to_s "#{project_name}:#{resource_name}" end |