Class: Tram::Page::Section

Inherits:
Object
  • Object
show all
Extended by:
Dry::Initializer
Defined in:
lib/tram/page/section.rb

Overview

Contains class-level definition (name and options) for a section with a method [#call] that extracts the section part of hash from an instance of [Tram::Page]

Instance Method Summary collapse

Instance Method Details

#call(page) ⇒ Hash

Returns a part of the section.

Parameters:

Returns:

  • (Hash)

    a part of the section



19
20
21
# File 'lib/tram/page/section.rb', line 19

def call(page)
  skip_on?(page) ? {} : { name => value_at(page) }
end