Module: Darstellung::Definable

Included in:
Representable
Defined in:
lib/darstellung/definable.rb

Overview

This module contains access from the instance level to the attribute definitions provided by the macros.

Since:

  • 0.0.0

Instance Method Summary collapse

Instance Method Details

#detail_attributesHash

Get all the attributes that are used in the detail representation.

Examples:

Get all the detail attributes fields.

user_resource.detail_attributes

Returns:

  • (Hash)

    The name/attribute pairs.

Since:

  • 0.0.0



18
19
20
# File 'lib/darstellung/definable.rb', line 18

def detail_attributes
  self.class.detail_attributes
end

#summary_attributesHash

Get all the attributes that are used in the summary representation.

Examples:

Get all the summary attributes fields.

user_resource.summary_attributes

Returns:

  • (Hash)

    The name/attribute pairs.

Since:

  • 0.0.0



30
31
32
# File 'lib/darstellung/definable.rb', line 30

def summary_attributes
  self.class.summary_attributes
end