Class: MetaRuby::GUI::HTML::Page::Fragment

Inherits:
Object
  • Object
show all
Defined in:
lib/metaruby/gui/html/page.rb

Overview

A page fragment (or section)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title, html, id: nil, buttons: Array.new) ⇒ Fragment

Create a new fragment



96
97
98
99
100
101
# File 'lib/metaruby/gui/html/page.rb', line 96

def initialize(title, html, id: nil, buttons: Array.new)
    @title = title
    @html = html
    @id = id
    @buttons = buttons
end

Instance Attribute Details

#buttonsArray<Button> (readonly)

A list of buttons to be rendered before the fragment title and its content

Returns:



93
94
95
# File 'lib/metaruby/gui/html/page.rb', line 93

def buttons
  @buttons
end

#htmlObject

The fragment’s HTML content



86
87
88
# File 'lib/metaruby/gui/html/page.rb', line 86

def html
  @html
end

#idObject

The fragment ID (as, in, HTML id)



88
89
90
# File 'lib/metaruby/gui/html/page.rb', line 88

def id
  @id
end

#titleObject

The fragmen title (rendered with <h2>)



84
85
86
# File 'lib/metaruby/gui/html/page.rb', line 84

def title
  @title
end