Class: LittleGhost::FrameworkPrompts::Entry
- Inherits:
-
Data
- Object
- Data
- LittleGhost::FrameworkPrompts::Entry
- Defined in:
- lib/little_ghost/framework_prompts.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#locals ⇒ Object
readonly
Returns the value of attribute locals.
-
#required ⇒ Object
readonly
Returns the value of attribute required.
-
#summary ⇒ Object
readonly
Returns the value of attribute summary.
Instance Method Summary collapse
-
#initialize(key:, summary:, locals: [], required: false) ⇒ Entry
constructor
A new instance of Entry.
- #relative_path ⇒ Object
Constructor Details
#initialize(key:, summary:, locals: [], required: false) ⇒ Entry
Returns a new instance of Entry.
70 71 72 73 74 75 76 77 |
# File 'lib/little_ghost/framework_prompts.rb', line 70 def initialize(key:, summary:, locals: [], required: false) super( key: String(key).freeze, summary: String(summary).freeze, locals: Array(locals).map(&:to_sym).freeze, required: required == true ) end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key
69 70 71 |
# File 'lib/little_ghost/framework_prompts.rb', line 69 def key @key end |
#locals ⇒ Object (readonly)
Returns the value of attribute locals
69 70 71 |
# File 'lib/little_ghost/framework_prompts.rb', line 69 def locals @locals end |
#required ⇒ Object (readonly)
Returns the value of attribute required
69 70 71 |
# File 'lib/little_ghost/framework_prompts.rb', line 69 def required @required end |
#summary ⇒ Object (readonly)
Returns the value of attribute summary
69 70 71 |
# File 'lib/little_ghost/framework_prompts.rb', line 69 def summary @summary end |
Instance Method Details
#relative_path ⇒ Object
79 |
# File 'lib/little_ghost/framework_prompts.rb', line 79 def relative_path = File.join(PREFIX, "#{key}.erb") |