Module: Democritus
- Defined in:
- lib/democritus.rb,
lib/democritus/version.rb,
lib/democritus/class_builder.rb,
lib/democritus/class_builder/command.rb,
lib/democritus/class_builder/commands.rb,
lib/democritus/from_json_class_builder.rb,
lib/democritus/class_builder/commands/attribute.rb,
lib/democritus/class_builder/commands/attributes.rb
Overview
Compose objects by leveraging a DSL for class creation. Yes, we can write code that conforms to interfaces, but in my experience, as the Ruby object ecosystem has grown, so too has the needs for understanding the galaxy of objects.
Defined Under Namespace
Modules: Commands, DemocritusObjectTag Classes: ClassBuilder, FromJsonClassBuilder
Constant Summary collapse
- VERSION =
Democritus is striving to adhere to semantic versioning.
"0.2.1"
Class Method Summary collapse
-
.build {|Democritus::ClassBuilder| ... } ⇒ Object
Responsible for building a class based on atomic components.
-
.build_from_json(json) ⇒ Object
Responsible for building a class based on the given JSON object.
Class Method Details
.build {|Democritus::ClassBuilder| ... } ⇒ Object
Responsible for building a class based on atomic components.
28 29 30 31 32 |
# File 'lib/democritus.rb', line 28 def self.build(&configuration_block) builder = ClassBuilder.new builder.customize(&configuration_block) builder.generate_class end |
.build_from_json(json) ⇒ Object
Responsible for building a class based on the given JSON object.
50 51 52 53 |
# File 'lib/democritus.rb', line 50 def self.build_from_json(json) builder = FromJsonClassBuilder.new(json) builder.generate_class end |