Class: Hecks::Forms::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/hecks/forms.rb

Overview

expose's own declaration — "which chapters does this app expose" — kept OUTSIDE the Hecks.* collector convention (Hecks.bluebook, Hecks.hecksagon, ...) and outside Runtime::Registry entirely, on purpose: a real language word goes through syntax.bluebook and MetaValidator (see docs/implemented/guides/extending-hecks.md, "a new word is a declared row before it is a line of Ruby") and is judged by spec/syntax_conformance_spec.rb + spec/dsl_coverage_spec.rb — gates this construct has not earned yet. An ordinary Ruby DSL, one level of module state, no different in kind from a project's own initializer — see docs/command-form-and-query-form-bluebook.md, "why this isn't syntax.bluebook yet".

ONE expose GRANTS A WHOLE CHAPTER, not a command or a query individually — the future command_form.bluebook/query_form.bluebook words are PER-DECLARATION (one command, one query, its own form/view, possibly its own overrides), which expose doesn't do today and was never trying to; it's the coarse "turn this chapter's forms on at all" switch those finer words will eventually sit inside.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Config

Returns a new instance of Config.



38
39
40
41
# File 'lib/hecks/forms.rb', line 38

def initialize(name)
  @name    = name.to_s
  @exposes = []
end

Instance Attribute Details

#exposesObject (readonly)

Returns the value of attribute exposes.



36
37
38
# File 'lib/hecks/forms.rb', line 36

def exposes
  @exposes
end

#nameObject (readonly)

Returns the value of attribute name.



36
37
38
# File 'lib/hecks/forms.rb', line 36

def name
  @name
end

Instance Method Details

#expose(chapter_name) ⇒ Object



43
# File 'lib/hecks/forms.rb', line 43

def expose(chapter_name) = @exposes << chapter_name.to_s