Class: LittleGhost::FrameworkPrompts::Entry

Inherits:
Data
  • Object
show all
Defined in:
lib/little_ghost/framework_prompts.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#keyObject (readonly)

Returns the value of attribute key

Returns:

  • (Object)

    the current value of key



69
70
71
# File 'lib/little_ghost/framework_prompts.rb', line 69

def key
  @key
end

#localsObject (readonly)

Returns the value of attribute locals

Returns:

  • (Object)

    the current value of locals



69
70
71
# File 'lib/little_ghost/framework_prompts.rb', line 69

def locals
  @locals
end

#requiredObject (readonly)

Returns the value of attribute required

Returns:

  • (Object)

    the current value of required



69
70
71
# File 'lib/little_ghost/framework_prompts.rb', line 69

def required
  @required
end

#summaryObject (readonly)

Returns the value of attribute summary

Returns:

  • (Object)

    the current value of summary



69
70
71
# File 'lib/little_ghost/framework_prompts.rb', line 69

def summary
  @summary
end

Instance Method Details

#relative_pathObject



79
# File 'lib/little_ghost/framework_prompts.rb', line 79

def relative_path = File.join(PREFIX, "#{key}.erb")