Module: Card::Set::Abstract::Pointer::OtherViews::JsonFormat

Extended by:
Card::Set::AbstractFormat
Defined in:
tmpsets/set/mod008-pointer/abstract/02_pointer/other_views.rb

Overview

JSON views

Instance Method Summary collapse

Instance Method Details

#essentialsObject



72
73
74
75
76
77
# File 'tmpsets/set/mod008-pointer/abstract/02_pointer/other_views.rb', line 72

def essentials
  return {} if depth > max_depth
  card.item_cards.map do |item|
    nest item, view: :essentials
  end
end

#item_cardsObject



60
61
62
# File 'tmpsets/set/mod008-pointer/abstract/02_pointer/other_views.rb', line 60

def item_cards
  card.item_cards
end

#items_for_exportObject



68
69
70
# File 'tmpsets/set/mod008-pointer/abstract/02_pointer/other_views.rb', line 68

def items_for_export
  card.item_cards
end

#max_depthObject



64
65
66
# File 'tmpsets/set/mod008-pointer/abstract/02_pointer/other_views.rb', line 64

def max_depth
  params[:max_depth] || 1
end