Class: Decidim::Core::ParticipatorySpaceLinkType

Inherits:
Api::Types::BaseObject show all
Defined in:
decidim-core/lib/decidim/api/types/participatory_space_link_type.rb

Instance Method Summary collapse

Instance Method Details

#participatory_spaceObject


14
15
16
17
18
19
# File 'decidim-core/lib/decidim/api/types/participatory_space_link_type.rb', line 14

def participatory_space
  manifest_name = object.name.partition("included_").last
  object_class = "Decidim::#{manifest_name.classify}"
  return object.to if object.to_type == object_class
  return object.from if object.from_type == object_class
end