Class: Kitchen::Driver::VmpoolStores::GitlabSnippetStore
- Defined in:
- lib/kitchen/driver/vmpool_stores/gitlab_snippet_store.rb
Instance Attribute Summary collapse
-
#pool_file ⇒ Object
readonly
Returns the value of attribute pool_file.
-
#project_id ⇒ Object
Returns the value of attribute project_id.
-
#snippet_id ⇒ Object
Returns the value of attribute snippet_id.
Attributes inherited from BaseStore
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(options = nil) ⇒ GitlabSnippetStore
constructor
A new instance of GitlabSnippetStore.
- #save ⇒ Object
- #update(content = nil) ⇒ Object
Methods inherited from BaseStore
Constructor Details
#initialize(options = nil) ⇒ GitlabSnippetStore
Returns a new instance of GitlabSnippetStore.
15 16 17 18 19 20 21 |
# File 'lib/kitchen/driver/vmpool_stores/gitlab_snippet_store.rb', line 15 def initialize( = nil) ||= { project_id: nil, snippet_id: nil, pool_file: 'vmpool'} raise ArgumentError.new("You must pass the project_id option") unless ['project_id'].to_i > 0 @snippet_id = ['snippet_id'] #ie. 630 @project_id = ['project_id'] #ie. 89 @pool_file = ['pool_file'] end |
Instance Attribute Details
#pool_file ⇒ Object (readonly)
Returns the value of attribute pool_file.
10 11 12 |
# File 'lib/kitchen/driver/vmpool_stores/gitlab_snippet_store.rb', line 10 def pool_file @pool_file end |
#project_id ⇒ Object
Returns the value of attribute project_id.
9 10 11 |
# File 'lib/kitchen/driver/vmpool_stores/gitlab_snippet_store.rb', line 9 def project_id @project_id end |
#snippet_id ⇒ Object
Returns the value of attribute snippet_id.
9 10 11 |
# File 'lib/kitchen/driver/vmpool_stores/gitlab_snippet_store.rb', line 9 def snippet_id @snippet_id end |
Instance Method Details
#create ⇒ Object
29 30 31 32 33 34 |
# File 'lib/kitchen/driver/vmpool_stores/gitlab_snippet_store.rb', line 29 def create #info("Creating new vmpool data snippet") snippet = create_snippet @snippet_id = snippet.id read end |
#save ⇒ Object
36 37 38 39 40 |
# File 'lib/kitchen/driver/vmpool_stores/gitlab_snippet_store.rb', line 36 def save #info("Saving vmpool data") update_snippet read end |
#update(content = nil) ⇒ Object
23 24 25 26 27 |
# File 'lib/kitchen/driver/vmpool_stores/gitlab_snippet_store.rb', line 23 def update(content = nil) #info("Updating vmpool data") update_snippet read end |