Module: Card::Set::All::ViewViz::HtmlFormat

Extended by:
Card::Set::AbstractFormat
Defined in:
card/tmpsets/set/mod039-card-mod-monkey/all/view_viz.rb,
card/tmpsets/set/mod040-card-mod-monkey/all/view_viz.rb

Instance Method Summary collapse

Instance Method Details

#view: views_by_formatObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'card/tmpsets/set/mod039-card-mod-monkey/all/view_viz.rb', line 9

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_nameObject



24
25
26
27
28
29
# File 'card/tmpsets/set/mod039-card-mod-monkey/all/view_viz.rb', line 24

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