Class: ActionModelContext::Resource
- Inherits:
-
Object
- Object
- ActionModelContext::Resource
- Includes:
- Primitive
- Defined in:
- lib/action_model_context/resource.rb
Overview
Base class of the resources. An application subclasses it through ApplicationResource, under app/mcp/resources.
Instance Attribute Summary
Attributes included from Primitive
Class Method Summary collapse
-
.mime_type(value = nil) ⇒ String?
Declares the MIME type, or reads it.
-
.resource_name(name = nil) ⇒ String?
Declares the name, or reads it.
-
.uri(value = nil) ⇒ String?
Declares the URI, or reads it.
Instance Method Summary collapse
-
#read ⇒ String, ...
Reads the resource.
Methods included from Primitive
Class Method Details
.mime_type(value = nil) ⇒ String?
Declares the MIME type, or reads it. Subclasses inherit it, and it overrides the one derived from #read.
.resource_name(name = nil) ⇒ String?
Declares the name, or reads it.
.uri(value = nil) ⇒ String?
Declares the URI, or reads it. A {variable} makes the resource a template, and subclasses do not inherit it.
Instance Method Details
#read ⇒ String, ...
Reads the resource. A subclass defines it, with one keyword per variable of the URI.