Class: Navigasmic::Builder::MapBuilder
- Defined in:
- lib/navigasmic/builders/map_builder.rb
Defined Under Namespace
Classes: Configuration
Instance Method Summary collapse
- #group(label = nil, options = {}, &block) ⇒ Object
-
#initialize(context, name, options, &block) ⇒ MapBuilder
constructor
A new instance of MapBuilder.
- #item(label, *args, &block) ⇒ Object
- #render ⇒ Object
Constructor Details
#initialize(context, name, options, &block) ⇒ MapBuilder
Returns a new instance of MapBuilder.
31 32 33 34 35 36 37 |
# File 'lib/navigasmic/builders/map_builder.rb', line 31 def initialize(context, name, , &block) super @options['xmlns'] ||= @config.xmlns @options['xmlns:xsi'] ||= @config.xmlns_xsi @options['xsi:schemaLocation'] ||= @config.schema_location @options[:changefreq] ||= @config.changefreq end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Navigasmic::Builder::Base
Instance Method Details
#group(label = nil, options = {}, &block) ⇒ Object
43 44 45 46 47 48 |
# File 'lib/navigasmic/builders/map_builder.rb', line 43 def group(label = nil, = {}, &block) raise ArgumentError, "Missing block for group" unless block_given? return '' unless visible?() concat(capture(&block)) end |
#item(label, *args, &block) ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/navigasmic/builders/map_builder.rb', line 50 def item(label, *args, &block) = args. = () return '' unless visible?() item = Navigasmic::Item.new(label, extract_and_determine_link(label, , *args), visible?(), ) concat(capture(&block)) if block_given? return '' unless item.link? concat(structure_for(label, item.link, )) end |
#render ⇒ Object
39 40 41 |
# File 'lib/navigasmic/builders/map_builder.rb', line 39 def render content_tag(@config.wrapper_tag, capture(&@definition), @options) end |