Class: Fabulator::Exhibit::Actions::Type

Inherits:
Action
  • Object
show all
Defined in:
lib/fabulator/exhibit/actions/type.rb

Instance Method Summary collapse

Instance Method Details

#run(context, autovivify = false) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/fabulator/exhibit/actions/type.rb', line 11

def run(context, autovivify = false)
  @context.with(context) do |ctx|
    info = { 'id' => self.name(ctx).first.to_s }
    pl = (self.pluralLabel(ctx).first.to_s rescue nil)
    if !pl.nil?
      info['pluralLabel'] = pl
    end
    Fabulator::Exhibit::Lib.add_info(
      self.database(ctx).first.to_s, :types, info
    )
  end
end