Class: HtmlCom::Tabs::Tab

Inherits:
Object
  • Object
show all
Defined in:
lib/htmlcom.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title, content: '', callback: nil) ⇒ Tab

Returns a new instance of Tab.



91
92
93
# File 'lib/htmlcom.rb', line 91

def initialize(title, content: '', callback: nil)
  @title, @content, @callback = title, content, callback
end

Instance Attribute Details

#contentObject

Returns the value of attribute content.



89
90
91
# File 'lib/htmlcom.rb', line 89

def content
  @content
end

#titleObject

Returns the value of attribute title.



89
90
91
# File 'lib/htmlcom.rb', line 89

def title
  @title
end

Instance Method Details

#deleteObject



100
101
102
103
# File 'lib/htmlcom.rb', line 100

def delete()
  @title = nil
  @callback.ping
end

#to_aObject



110
111
112
# File 'lib/htmlcom.rb', line 110

def to_a()
  [@title, @content]
end