A summary of data about the Ruby ecosystem.

https://github.com/apotonick/declarative

DSL for nested schemas.
https://github.com/apotonick/declarative

Keywords from Contributors

json-parser rack sinatra activejob activerecord mvc json-serialization xml-parser xml-serialization

Last synced: about 15 hours ago
JSON representation

Repository metadata

DSL for nested schemas.

README.md

Declarative

DSL for nested schemas.

Gem Version

Overview

Declarative allows declaring nested schemas.

Installation

Add this line to your application's Gemfile:

gem 'declarative'

Declarative::Schema

Include this into a class or module to allow defining nested schemas using the popular ::property DSL.

Normally, an abstract base class will define essential configuration.

class Model
 extend Declarative::Schema

  def self.default_nested_class
    Model
  end
end

Concrete schema-users simply derive from the base class.

class Song < Model
  property :id

  property :artist do
    property :id
    property :name
  end
end

This won't do anything but populate the ::definitions graph.

Song.definitions #=>

<Definition "id">
<Definition "artist" nested=..>
  <Definition "id">
  <Definition "name">

The nested schema will be a subclass of Model.

Song.definitions.get(:artist) #=> <Anonymous:Model definitions=..>

Overriding Nested Building

When declaring nested schemas, per default, Declarative will use its own Schema::NestedBuilder to create the nested schema composer.

Override ::nested_builder to define your own way of doing that.

class Model
  extend Declarative::Schema

  def self.default_nested_class
    Model
  end

  def self.nested_builder
    ->(options) do
      Class.new(Model) do
        class_eval &options[:_block] # executes `property :name` etc. on nested, fresh class.
      end
    end
  end
end

Features

You can automatically include modules into all nested schemas by using ::feature.

class Model
  extend Declarative::Schema
  feature Bla

Defaults

class Model
  extend Declarative::Schema
  defaults visible: true

Copyright


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 4 days ago

Total Commits: 107
Total Committers: 6
Avg Commits per committer: 17.833
Development Distribution Score (DDS): 0.084

Commits in past year: 2
Committers in past year: 2
Avg Commits per committer in past year: 1.0
Development Distribution Score (DDS) in past year: 0.5

Name Email Commits
Nick Sutterer a****k@g****m 98
Abinoam P. Marques Jr a****m@g****m 4
Abdelkader Boudih t****e@g****m 2
Zahidul Haque i****i@g****m 1
Takashi Masuda m****a@f****p 1
Josef Šimánek j****k@g****m 1

Committer domains:


Issue and Pull Request metadata

Last synced: 3 months ago

Total issues: 3
Total pull requests: 7
Average time to close issues: N/A
Average time to close pull requests: 29 days
Total issue authors: 3
Total pull request authors: 7
Average comments per issue: 2.0
Average comments per pull request: 3.29
Merged pull request: 5
Bot issues: 0
Bot pull requests: 0

Past year issues: 0
Past year pull requests: 1
Past year average time to close issues: N/A
Past year average time to close pull requests: 2 months
Past year issue authors: 0
Past year pull request authors: 1
Past year average comments per issue: 0
Past year average comments per pull request: 20.0
Past year merged pull request: 1
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/apotonick/declarative

Top Issue Authors

  • shmokmt (1)
  • jamesbebbington (1)
  • aldesantis (1)

Top Pull Request Authors

  • simi (2)
  • abinoam (1)
  • terceiro (1)
  • opodartho (1)
  • masutaka (1)
  • seuros (1)
  • nageshlop (1)

Top Issue Labels

Top Pull Request Labels


Package metadata

gem.coop: declarative

DSL for nested generic schemas with inheritance and refining.

  • Homepage: https://github.com/apotonick/declarative
  • Documentation: http://www.rubydoc.info/gems/declarative/
  • Licenses: MIT
  • Latest release: 0.0.20 (published over 5 years ago)
  • Last Synced: 2025-12-07T22:31:24.442Z (3 days ago)
  • Versions: 11
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 311,105,014 Total
  • Docker Downloads: 569,309,312
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 0.059%
    • Downloads: 0.075%
    • Docker downloads count: 0.163%
  • Maintainers (2)
rubygems.org: declarative

DSL for nested generic schemas with inheritance and refining.

  • Homepage: https://github.com/apotonick/declarative
  • Documentation: http://www.rubydoc.info/gems/declarative/
  • Licenses: MIT
  • Latest release: 0.0.20 (published over 5 years ago)
  • Last Synced: 2025-12-06T23:02:11.330Z (4 days ago)
  • Versions: 11
  • Dependent Packages: 6
  • Dependent Repositories: 26,022
  • Downloads: 311,054,902 Total
  • Docker Downloads: 569,309,312
  • Rankings:
    • Downloads: 0.085%
    • Dependent repos count: 0.221%
    • Docker downloads count: 0.229%
    • Dependent packages count: 2.484%
    • Average: 3.969%
    • Forks count: 9.679%
    • Stargazers count: 11.117%
  • Maintainers (2)

Dependencies

declarative.gemspec rubygems
  • minitest >= 0 development
  • minitest-line >= 0 development
  • rake >= 0 development
.github/workflows/build.yml actions
  • actions/checkout v4 composite
  • ruby/setup-ruby v1 composite
Gemfile rubygems

Score: 26.338893598373133