Class: Lono::Conventions
- Inherits:
-
Object
- Object
- Lono::Conventions
- Defined in:
- lib/lono/conventions.rb
Instance Attribute Summary collapse
-
#blueprint ⇒ Object
readonly
Returns the value of attribute blueprint.
-
#param ⇒ Object
readonly
Returns the value of attribute param.
-
#stack ⇒ Object
readonly
Returns the value of attribute stack.
-
#template ⇒ Object
readonly
Returns the value of attribute template.
Instance Method Summary collapse
-
#initialize(options) ⇒ Conventions
constructor
A new instance of Conventions.
- #naming_conventions(options) ⇒ Object
- #values ⇒ Object
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 = @stack, @blueprint, @template, @param = naming_conventions() end |
Instance Attribute Details
#blueprint ⇒ Object (readonly)
Returns the value of attribute blueprint.
3 4 5 |
# File 'lib/lono/conventions.rb', line 3 def blueprint @blueprint end |
#param ⇒ Object (readonly)
Returns the value of attribute param.
3 4 5 |
# File 'lib/lono/conventions.rb', line 3 def param @param end |
#stack ⇒ Object (readonly)
Returns the value of attribute stack.
3 4 5 |
# File 'lib/lono/conventions.rb', line 3 def stack @stack end |
#template ⇒ Object (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 17 |
# File 'lib/lono/conventions.rb', line 9 def naming_conventions() o = .deep_symbolize_keys stack = o[:stack] blueprint = o[:blueprint] || o[:stack] template = o[:template] || blueprint param = o[:param] || template || blueprint stack ||= blueprint # fallback for commands that dont take stack name. IE: lono generate [stack, blueprint, template, param] end |
#values ⇒ Object
19 20 21 |
# File 'lib/lono/conventions.rb', line 19 def values [@stack, @blueprint, @template, @param] end |