Class: SFRest::Codebase
- Inherits:
-
Object
- Object
- SFRest::Codebase
- Defined in:
- lib/sfrest/codebase.rb
Overview
List codebases on the factory.
Instance Method Summary collapse
-
#edit_stacks(stack_id, name, description, tangle_alias) ⇒ Array
Edits stack name and description.
-
#initialize(conn) ⇒ Codebase
constructor
A new instance of Codebase.
-
#list ⇒ Hash
Lists the codebases { “stacks” => { 1 => “abcde”, 2 => ‘fghij’ } }.
-
#stacks_with_details ⇒ Hash
Lists the codebases with details.
Constructor Details
#initialize(conn) ⇒ Codebase
Returns a new instance of Codebase.
7 8 9 |
# File 'lib/sfrest/codebase.rb', line 7 def initialize(conn) @conn = conn end |
Instance Method Details
#edit_stacks(stack_id, name, description, tangle_alias) ⇒ Array
Edits stack name and description.
25 26 27 28 29 30 31 32 |
# File 'lib/sfrest/codebase.rb', line 25 def edit_stacks(stack_id, name, description, tangle_alias) payload = { 'name' => name, 'description' => description, 'tangle_alias' => tangle_alias } @conn.put("/api/v1/stacks/#{stack_id}", payload.to_json) end |
#list ⇒ Hash
Lists the codebases { “stacks” => { 1 => “abcde”, 2 => ‘fghij’ } }
14 15 16 |
# File 'lib/sfrest/codebase.rb', line 14 def list @conn.get('/api/v1/stacks') end |
#stacks_with_details ⇒ Hash
Lists the codebases with details. {“id”: 1, “name”: “name”, “description”: “description”, “tangle_alias”: “tangle1” }
37 38 39 |
# File 'lib/sfrest/codebase.rb', line 37 def stacks_with_details @conn.get('/api/v1/stacks/details') end |