Module: Decidim::Core::AuthorInterface

Includes:
Api::Types::BaseInterface
Defined in:
decidim-core/lib/decidim/api/interfaces/author_interface.rb

Overview

This interface represents an author who owns a resource.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.resolve_type(obj, _ctx) ⇒ Object


26
27
28
29
# File 'decidim-core/lib/decidim/api/interfaces/author_interface.rb', line 26

def self.resolve_type(obj, _ctx)
  return Decidim::Core::UserType if obj.is_a? Decidim::User
  return Decidim::Core::UserGroupType if obj.is_a? Decidim::UserGroup
end

Instance Method Details

#organization_nameObject


20
21
22
# File 'decidim-core/lib/decidim/api/interfaces/author_interface.rb', line 20

def organization_name
  object.organization.name
end