Class: Lono::Conventions

Inherits:
Object
  • Object
show all
Defined in:
lib/lono/conventions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Conventions

Returns a new instance of Conventions.



4
5
6
7
# File 'lib/lono/conventions.rb', line 4

def initialize(options)
  @options = options
  @stack, @blueprint, @template, @param = naming_conventions(options)
end

Instance Attribute Details

#blueprintObject (readonly)

Returns the value of attribute blueprint.



3
4
5
# File 'lib/lono/conventions.rb', line 3

def blueprint
  @blueprint
end

#paramObject (readonly)

Returns the value of attribute param.



3
4
5
# File 'lib/lono/conventions.rb', line 3

def param
  @param
end

#stackObject (readonly)

Returns the value of attribute stack.



3
4
5
# File 'lib/lono/conventions.rb', line 3

def stack
  @stack
end

#templateObject (readonly)

Returns the value of attribute template.



3
4
5
# File 'lib/lono/conventions.rb', line 3

def template
  @template
end

Instance Method Details

#naming_conventions(options) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/lono/conventions.rb', line 9

def naming_conventions(options)
  o = options.deep_symbolize_keys
  stack = o[:stack]
  blueprint = o[:blueprint] || o[:stack]
  template = o[:template] || blueprint
  param = o[:param] || template || blueprint
  [stack, blueprint, template, param]
end

#valuesObject



18
19
20
# File 'lib/lono/conventions.rb', line 18

def values
  [@stack, @blueprint, @template, @param]
end