Sha256: 25bd4102a99b65f24146f7b9b868a79558c1063cd5d75d047c654f3aa09bd192
Contents?: true
Size: 631 Bytes
Versions: 24
Compression:
Stored size: 631 Bytes
Contents
class Tramway::Landing::NavbarDecorator < ::Tramway::Core::ApplicationDecoratedCollection def initialize(array) original = if array.any? { |obj| obj.is_a? Hash } get_original_array array else array end super array, original end def original_array get_original_array @original_array end def dropdown_title object.keys.first end private def get_original_array(arr) arr.reduce([]) do |array, obj| if obj.is_a? Hash array += obj.values.first.original_array else array << obj end end end end
Version data entries
24 entries across 24 versions & 1 rubygems