Class: Card::Format::Nest
- Inherits:
-
Object
- Object
- Card::Format::Nest
- Includes:
- Fetch
- Defined in:
- lib/card/format/nest.rb,
lib/card/format/nest/fetch.rb
Overview
processing nests
Defined Under Namespace
Modules: Fetch
Instance Attribute Summary collapse
-
#card ⇒ Object
Returns the value of attribute card.
-
#format ⇒ Object
Returns the value of attribute format.
-
#format_opts ⇒ Object
Returns the value of attribute format_opts.
-
#view ⇒ Object
Returns the value of attribute view.
-
#view_opts ⇒ Object
Returns the value of attribute view_opts.
Instance Method Summary collapse
-
#initialize(format, cardish, view_opts = {}, format_opts = {}) ⇒ Nest
constructor
A new instance of Nest.
- #prepare {|subformat, view| ... } ⇒ Object
Constructor Details
#initialize(format, cardish, view_opts = {}, format_opts = {}) ⇒ Nest
Returns a new instance of Nest.
8 9 10 11 12 13 14 15 |
# File 'lib/card/format/nest.rb', line 8 def initialize format, cardish, view_opts={}, format_opts={} @format = format @view_opts = view_opts @format_opts = format_opts.clone @override = @format_opts.delete(:override) != false @card ||= fetch_card cardish # note: fetch_card can alter view and view_opts[:nest_name] end |
Instance Attribute Details
#card ⇒ Object
Returns the value of attribute card.
7 8 9 |
# File 'lib/card/format/nest.rb', line 7 def card @card end |
#format ⇒ Object
Returns the value of attribute format.
7 8 9 |
# File 'lib/card/format/nest.rb', line 7 def format @format end |
#format_opts ⇒ Object
Returns the value of attribute format_opts.
7 8 9 |
# File 'lib/card/format/nest.rb', line 7 def format_opts @format_opts end |
#view ⇒ Object
Returns the value of attribute view.
7 8 9 |
# File 'lib/card/format/nest.rb', line 7 def view @view end |
#view_opts ⇒ Object
Returns the value of attribute view_opts.
7 8 9 |
# File 'lib/card/format/nest.rb', line 7 def view_opts @view_opts end |
Instance Method Details
#prepare {|subformat, view| ... } ⇒ Object
17 18 19 20 21 22 |
# File 'lib/card/format/nest.rb', line 17 def prepare prepare_view_and_opts! subformat = prepare_subformat @view = subformat.modal_nest_view @view if @override yield subformat, view end |