{
    "content": [
        {
            "type": "text",
            "text": "# ActiveModel::Validations (ri)\n\n## Sections\n\n- **ActiveModel::Validations**\n- **Includes:**\n- **Extended by:** (1 subsections)\n- **Instance methods:**\n- **Attributes:**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "ActiveModel::Validations",
        "section": "",
        "mode": "ri",
        "summary": null,
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "ActiveModel::Validations",
                "lines": 1,
                "subsections": []
            },
            {
                "name": "Includes:",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "Extended by:",
                "lines": 9,
                "subsections": [
                    {
                        "name": "Active Model Validations",
                        "lines": 44
                    }
                ]
            },
            {
                "name": "Instance methods:",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "Attributes:",
                "lines": 2,
                "subsections": []
            }
        ],
        "sections": {
            "ActiveModel::Validations": {
                "content": "------------------------------------------------------------------------",
                "subsections": []
            },
            "Includes:": {
                "content": "HelperMethods (from /home/chedong/.local/share/rdoc)\n\n------------------------------------------------------------------------",
                "subsections": []
            },
            "Extended by:": {
                "content": "(from /home/chedong/.local/share/rdoc)\nActiveSupport::Concern\nActiveModel::Naming\nActiveModel::Callbacks\nActiveModel::Translation\nHelperMethods\n\n(from /home/chedong/.local/share/rdoc)\n------------------------------------------------------------------------",
                "subsections": [
                    {
                        "name": "Active Model Validations",
                        "content": "Provides a full validation framework to your objects.\n\nA minimal implementation could be:\n\nclass Person\ninclude ActiveModel::Validations\n\nattraccessor :firstname, :lastname\n\nvalidateseach :firstname, :lastname do |record, attr, value|\nrecord.errors.add attr, \"starts with z.\" if value.startwith?(\"z\")\nend\nend\n\nWhich provides you with the full standard validation stack that you know\nfrom Active Record:\n\nperson = Person.new\nperson.valid?                   # => true\nperson.invalid?                 # => false\n\nperson.firstname = 'zoolander'\nperson.valid?                   # => false\nperson.invalid?                 # => true\nperson.errors.messages          # => {firstname:[\"starts with z.\"]}\n\nNote that ActiveModel::Validations automatically adds an errors method\nto your instances initialized with a new ActiveModel::Errors object, so\nthere is no need for you to do this manually.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n------------------------------------------------------------------------"
                    }
                ]
            },
            "Instance methods:": {
                "content": "errors\ninvalid?\nraisevalidationerror\nvalid?\nvalidate\nvalidate!\nvalidateswith\nvalidationcontext\n",
                "subsections": []
            },
            "Attributes:": {
                "content": "attraccessor validationcontext\n",
                "subsections": []
            }
        }
    }
}