Class: Anchor::Resource
- Inherits:
-
Object
- Object
- Anchor::Resource
- Defined in:
- lib/anchor/resource.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#resource_klass ⇒ Object
readonly
Returns the value of attribute resource_klass.
Instance Method Summary collapse
- #express ⇒ Object
-
#initialize(resource_klass) ⇒ Resource
constructor
resource_klass#anchor_attributes, #anchor_relationships, #anchor_attributes_descriptions, #anchor_relationships_descriptions are optional methods from Anchor::Annotatable.
Constructor Details
#initialize(resource_klass) ⇒ Resource
resource_klass#anchor_attributes, #anchor_relationships, #anchor_attributes_descriptions, #anchor_relationships_descriptions are optional methods from Anchor::Annotatable.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/anchor/resource.rb', line 9 def initialize(resource_klass) @resource_klass = resource_klass @anchor_attributes = resource_klass.try(:anchor_attributes) || {} @anchor_relationships = resource_klass.try(:anchor_relationships) || {} @anchor_attributes_descriptions = resource_klass.try(:anchor_attributes_descriptions) || {} @anchor_relationships_descriptions = resource_klass.try(:anchor_relationships_descriptions) || {} @anchor_method_added_count = resource_klass.anchor_method_added_count || Hash.new(0) @anchor_links_schema = resource_klass.try(:anchor_links_schema) || nil = resource_klass.try(:anchor_meta_schema) || nil end |
Instance Attribute Details
#resource_klass ⇒ Object (readonly)
Returns the value of attribute resource_klass.
4 5 6 |
# File 'lib/anchor/resource.rb', line 4 def resource_klass @resource_klass end |
Instance Method Details
#express ⇒ Object
20 21 22 |
# File 'lib/anchor/resource.rb', line 20 def express(...) raise NotImplementedError end |