Sha256: fed7879cdc6cb2963cba57da047009b063fee3931af8a062c72b32834478106b

Contents?: true

Size: 685 Bytes

Versions: 60

Compression:

Stored size: 685 Bytes

Contents

format :html do
  view :views_by_format do
    format_views =
      self.class.ancestors.each_with_object({}) do |format_class, hash|
        views =
          format_class.instance_methods.map do |method|
            next unless method.to_s =~ /^_view_(.+)$/
            Regexp.last_match(1)
          end.compact
        next unless  views.present?
        format_class.name =~ /^Card(::Set)?::(.+?)$/ #::(\w+Format)
        hash[Regexp.last_match(2)] = views
      end
    accordion_group format_views
  end

  view :views_by_name do
    views = methods.map do |method|
      Regexp.last_match(1) if method.to_s =~ /^_view_(.+)$/
    end.compact.sort
    list_group views
  end
end

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
card-1.100.0 mod/developer/set/all/view_viz.rb
card-1.99.6 mod/developer/set/all/view_viz.rb
card-1.99.5 mod/developer/set/all/view_viz.rb
card-1.99.4 mod/developer/set/all/view_viz.rb
card-1.99.3 mod/developer/set/all/view_viz.rb
card-1.99.2 mod/developer/set/all/view_viz.rb
card-1.99.1 mod/developer/set/all/view_viz.rb
card-1.99.0 mod/developer/set/all/view_viz.rb
card-1.98.3 mod/developer/set/all/view_viz.rb
card-1.98.2 mod/developer/set/all/view_viz.rb
card-1.98.1 mod/developer/set/all/view_viz.rb
card-1.98.0 mod/developer/set/all/view_viz.rb
card-1.97.0.1 mod/developer/set/all/view_viz.rb
card-1.97.0 mod/developer/set/all/view_viz.rb
card-1.96.8 mod/developer/set/all/view_viz.rb
card-1.96.7 mod/developer/set/all/view_viz.rb
card-1.96.6 mod/developer/set/all/view_viz.rb
card-1.96.5 mod/developer/set/all/view_viz.rb
card-1.96.4 mod/developer/set/all/view_viz.rb
card-1.96.3 mod/developer/set/all/view_viz.rb