class Cyoi::Cli::Blobstore::BlobstoreCliBase

Attributes

attributes[R]
hl[R]
provider_client[R]

Public Class Methods

new(provider_client, attributes, highline) click to toggle source
# File lib/cyoi/cli/provider_blobstore/blobstore_cli_base.rb, line 7
def initialize(provider_client, attributes, highline)
  @provider_client = provider_client
  @hl = highline
  @attributes = attributes.is_a?(Hash) ? ReadWriteSettings.new(attributes) : attributes
  raise "@attributes must be ReadWriteSettings (or Hash); was #{@attributes.class}" unless @attributes.is_a?(ReadWriteSettings)
end

Public Instance Methods

display_confirmation() click to toggle source
# File lib/cyoi/cli/provider_blobstore/blobstore_cli_base.rb, line 25
def display_confirmation
  puts "\n"
  puts "Confirming: Using blobstore #{attributes["name"]}"
end
export_attributes() click to toggle source

helper to export the complete nested attributes.

# File lib/cyoi/cli/provider_blobstore/blobstore_cli_base.rb, line 21
def export_attributes
  attributes.to_nested_hash
end
perform_and_return_attributes() click to toggle source
# File lib/cyoi/cli/provider_blobstore/blobstore_cli_base.rb, line 14
def perform_and_return_attributes
  # create blobstore OR show how many blobstore already exist in blobstore
  provider_client.create_blobstore(attributes["name"])
  export_attributes
end