Class: HasHelpers::Types::Search::ResultType
- Inherits:
-
BaseType
- Object
- GraphQL::Schema::Object
- BaseType
- HasHelpers::Types::Search::ResultType
show all
- Defined in:
- app/graphql/has_helpers/types/search/result_type.rb
Instance Method Summary
collapse
Methods inherited from BaseType
#current_organization, #current_user
Instance Method Details
#abbreviation ⇒ Object
48
49
50
|
# File 'app/graphql/has_helpers/types/search/result_type.rb', line 48
def abbreviation
object.try(:abbreviation)
end
|
#base_type ⇒ Object
28
29
30
|
# File 'app/graphql/has_helpers/types/search/result_type.rb', line 28
def base_type
type.safe_constantize&.base_class&.name
end
|
#details ⇒ Object
52
53
54
|
# File 'app/graphql/has_helpers/types/search/result_type.rb', line 52
def details
object.try(:detail)
end
|
#id ⇒ Object
20
21
22
|
# File 'app/graphql/has_helpers/types/search/result_type.rb', line 20
def id
object.try(:id)
end
|
#image_url ⇒ Object
36
37
38
|
# File 'app/graphql/has_helpers/types/search/result_type.rb', line 36
def image_url
photo_service&.url
end
|
#name ⇒ Object
32
33
34
|
# File 'app/graphql/has_helpers/types/search/result_type.rb', line 32
def name
object.try(:name)
end
|
#sub_item ⇒ Object
40
41
42
|
# File 'app/graphql/has_helpers/types/search/result_type.rb', line 40
def sub_item
object.try(:sub_item)
end
|
#sub_item_type ⇒ Object
44
45
46
|
# File 'app/graphql/has_helpers/types/search/result_type.rb', line 44
def sub_item_type
object.try(:sub_item_type)
end
|
#type ⇒ Object
24
25
26
|
# File 'app/graphql/has_helpers/types/search/result_type.rb', line 24
def type
object.try(:type) || object.class.name
end
|