Class: Terraspace::Plugin::Meta

Inherits:
Object
  • Object
show all
Defined in:
lib/terraspace/plugin/meta.rb

Instance Method Summary collapse

Constructor Details

#initialize(raw) ⇒ Meta

raw: => {root: “/path”, backend: “s3”



4
5
6
# File 'lib/terraspace/plugin/meta.rb', line 4

def initialize(raw)
  @raw = raw
end

Instance Method Details

#backendObject



21
22
23
# File 'lib/terraspace/plugin/meta.rb', line 21

def backend
  data[:backend]
end

#dataObject



17
18
19
# File 'lib/terraspace/plugin/meta.rb', line 17

def data
  @raw.values.first
end

#nameObject Also known as: plugin



8
9
10
11
12
13
14
# File 'lib/terraspace/plugin/meta.rb', line 8

def name
  name = @raw.keys.first
  unless name
    raise "No plugin found. Are you sure you have the terraspace_plugin_XXX configured in your Gemfile?"
  end
  name.camelize
end

#rootObject



25
26
27
# File 'lib/terraspace/plugin/meta.rb', line 25

def root
  data[:root]
end