Module: Card::Set::All::Path::Format

Extended by:
Card::Set::AbstractFormat
Defined in:
card/tmpsets/set/mod008-card-mod-format/all/path.rb,
card/tmpsets/set/mod007-card-mod-format/all/path.rb

Instance Method Summary collapse

Instance Method Details

#contextualize_path(relative_path) ⇒ Object

in base format (and therefore most other formats), even internal paths are rendered as absolute urls.



50
51
52
# File 'card/tmpsets/set/mod008-card-mod-format/all/path.rb', line 50

def contextualize_path relative_path
  card_url relative_path
end

#path(opts = {}) ⇒ Object

bypasses all processing

Parameters:

  • opts (Hash, String) (defaults to: {})

    a String is treated as a complete path and

Options Hash (opts):

  • :mark (String, Card::Name, Integer, Symbol, Card)
  • :action (Symbol)

    card action (:create, :update, :delete)

  • :format (Symbol)
  • :card (Hash)
  • :no_mark (TrueClass)


42
43
44
45
46
# File 'card/tmpsets/set/mod008-card-mod-format/all/path.rb', line 42

def path opts={}
  return opts unless opts.is_a? Hash
  path = Card::Path.new(card, opts)&.render
  contextualize_path path
end