Class: LcpRuby::Generators::DslToYaml::EvalContext
- Inherits:
-
Object
- Object
- LcpRuby::Generators::DslToYaml::EvalContext
- Defined in:
- lib/generators/lcp_ruby/dsl_to_yaml.rb
Instance Attribute Summary collapse
-
#builder ⇒ Object
readonly
Returns the value of attribute builder.
-
#inherits ⇒ Object
readonly
Returns the value of attribute inherits.
Instance Method Summary collapse
- #define_model(name, inherits: nil, &block) ⇒ Object
- #define_presenter(name, inherits: nil, &block) ⇒ Object
- #define_view_group(name, &block) ⇒ Object
Instance Attribute Details
#builder ⇒ Object (readonly)
Returns the value of attribute builder.
51 52 53 |
# File 'lib/generators/lcp_ruby/dsl_to_yaml.rb', line 51 def builder @builder end |
#inherits ⇒ Object (readonly)
Returns the value of attribute inherits.
51 52 53 |
# File 'lib/generators/lcp_ruby/dsl_to_yaml.rb', line 51 def inherits @inherits end |
Instance Method Details
#define_model(name, inherits: nil, &block) ⇒ Object
53 54 55 56 57 |
# File 'lib/generators/lcp_ruby/dsl_to_yaml.rb', line 53 def define_model(name, inherits: nil, &block) @inherits = inherits&.to_s @builder = Dsl::ModelBuilder.new(name) @builder.instance_eval(&block) end |
#define_presenter(name, inherits: nil, &block) ⇒ Object
59 60 61 62 63 |
# File 'lib/generators/lcp_ruby/dsl_to_yaml.rb', line 59 def define_presenter(name, inherits: nil, &block) @inherits = inherits&.to_s @builder = Dsl::PresenterBuilder.new(name) @builder.instance_eval(&block) end |
#define_view_group(name, &block) ⇒ Object
65 66 67 68 |
# File 'lib/generators/lcp_ruby/dsl_to_yaml.rb', line 65 def define_view_group(name, &block) @builder = Dsl::ViewGroupBuilder.new(name) @builder.instance_eval(&block) end |