doc/entities.md in power_stencil-0.3.2 vs doc/entities.md in power_stencil-0.3.3

- old
+ new

@@ -189,11 +189,11 @@ - Buildable : false ``` The goal of this command is normally to check the validity of entities, but it brings as well extra information like if the entity is _buildable_ or even where it is stored in the repository. -:information_source: You can notice that the `project_config` entity has no storage path, the reason being [it is not persisted](#default-entity-types). +:information_source: You can notice that the `project_config` entity has no storage path, the reason being [it is not persisted](#default-entity-types) in the entities repository (its content actually comes from config files outside of the repository). This command may show some extra information, for more complex entities. We will see that later on. By default `power_stencil check` will check all entities in the repository but you can specify on the command line an arbitrary list of entities: @@ -207,11 +207,11 @@ 'project_config/Project Config': - Storage path: '' - Status : Valid - Buildable : false ``` -Another possibility is to check a list of objects using a regular expression by using the `--regexp` option: +Another possibility is to check a list of objects using a regular expression (applied to the ID of an entity, ie `<entity_type</<entity_name>`) by using the `--regexp` option: ```shell $ power_stencil check base_ --regexp RAW ENTITIES 'base_entity/my_1st_entity': @@ -553,11 +553,11 @@ entity_type :custom_entity field :my_custom_field end ``` -Then it means I can access the `my_custom_field` property in two different ways: +Then it means I can access the `my_custom_field` property in three different ways: ```ruby PowerStencil DSL> e = new_custom_entity name: :test_entity => #<MyCustomEntity:47209361877520 composite_key=[:custom_entity, "test_entity"], @universe='Project entities (1566476673.765155)'> PowerStencil DSL> e.my_custom_field @@ -566,11 +566,13 @@ => "foo" PowerStencil DSL> e.my_custom_field => "foo" PowerStencil DSL> e.fields[:my_custom_field] => "foo" +PowerStencil DSL> e[:my_custom_field] +=> "foo" ``` -:information_source: You can notice the `new_<entity_type>` DSL method which is a shortcut to create entities. +:information_source: You can notice the `new_<entity_type>` DSL method which is a shortcut to create entities (actually you have to use this DSL method and not create entities using its `<classname>.new`, because this DSL method on top of creating the entity, setup everything for persistence as well...). So you can see the field directive will actually create accessor methods for first level properties in the `#fields` Hash. :warning: You can do pretty tricky things like: \ No newline at end of file