Class: Lono::Blueprint::Meta

Inherits:
Object
  • Object
show all
Extended by:
Memoist
Defined in:
lib/lono/blueprint/meta.rb

Instance Method Summary collapse

Constructor Details

#initialize(blueprint) ⇒ Meta

Returns a new instance of Meta.



7
8
9
# File 'lib/lono/blueprint/meta.rb', line 7

def initialize(blueprint)
  @blueprint = blueprint
end

Instance Method Details

#auto_camelize?(target_section) ⇒ Boolean

Returns:

  • (Boolean)


24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/lono/blueprint/meta.rb', line 24

def auto_camelize?(target_section)
  auto_camelize = data['auto_camelize']
  # auto_camelize.nil? for backward compatibility
  return true if auto_camelize.nil? || auto_camelize == true

  if auto_camelize == "except_resource"
    return target_section != "resource"
  end

  if auto_camelize.is_a?(Array)
    auto_camelize.include?(target_section)
  end
end

#dataObject



11
12
13
14
15
# File 'lib/lono/blueprint/meta.rb', line 11

def data
  blueprint_location = Find.find(@blueprint)
  meta_config = "#{blueprint_location}/.meta/config.yml"
  YAML.load_file(meta_config)
end