Class: Geoblacklight::RelationsComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/geoblacklight/relations_component.rb

Overview

Display expandable file download links in sidebar

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(relations:, relationship_type:, rel_type_info:) ⇒ RelationsComponent

Returns a new instance of RelationsComponent.



8
9
10
11
12
13
# File 'app/components/geoblacklight/relations_component.rb', line 8

def initialize(relations:, relationship_type:, rel_type_info:)
  @relations = relations
  @relationship_type = relationship_type
  @rel_type_info = rel_type_info
  super()
end

Instance Attribute Details

#rel_type_infoObject (readonly)

Returns the value of attribute rel_type_info.



6
7
8
# File 'app/components/geoblacklight/relations_component.rb', line 6

def rel_type_info
  @rel_type_info
end

#relationsObject (readonly)

Returns the value of attribute relations.



6
7
8
# File 'app/components/geoblacklight/relations_component.rb', line 6

def relations
  @relations
end

#relationship_typeObject (readonly)

Returns the value of attribute relationship_type.



6
7
8
# File 'app/components/geoblacklight/relations_component.rb', line 6

def relationship_type
  @relationship_type
end

Instance Method Details

#render?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'app/components/geoblacklight/relations_component.rb', line 15

def render?
  relationship_type_results["numFound"].to_i.positive?
end