Class: Contentful::Bootstrap::Commands::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/contentful/bootstrap/commands/base.rb

Direct Known Subclasses

CreateSpace, GenerateToken, UpdateSpace

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token, space, options = {}) ⇒ Base

Returns a new instance of Base.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/contentful/bootstrap/commands/base.rb', line 12

def initialize(token, space, options = {})
  trigger_oauth = options.fetch(:trigger_oauth, true)

  @token = token
  @options = options
  @quiet = options.fetch(:quiet, false)
  @no_input = options.fetch(:no_input, false)

  configuration if trigger_oauth
  management_client_init if trigger_oauth
  @space = space
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



10
11
12
# File 'lib/contentful/bootstrap/commands/base.rb', line 10

def client
  @client
end

#no_inputObject (readonly)

Returns the value of attribute no_input.



10
11
12
# File 'lib/contentful/bootstrap/commands/base.rb', line 10

def no_input
  @no_input
end

#optionsObject (readonly)

Returns the value of attribute options.



10
11
12
# File 'lib/contentful/bootstrap/commands/base.rb', line 10

def options
  @options
end

#quietObject (readonly)

Returns the value of attribute quiet.



10
11
12
# File 'lib/contentful/bootstrap/commands/base.rb', line 10

def quiet
  @quiet
end

#spaceObject (readonly)

Returns the value of attribute space.



10
11
12
# File 'lib/contentful/bootstrap/commands/base.rb', line 10

def space
  @space
end

#tokenObject (readonly)

Returns the value of attribute token.



10
11
12
# File 'lib/contentful/bootstrap/commands/base.rb', line 10

def token
  @token
end

Instance Method Details

#runObject



25
26
27
# File 'lib/contentful/bootstrap/commands/base.rb', line 25

def run
  fail 'must implement'
end