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, debug: false) ⇒ Tab

Returns a new instance of Tab.



142
143
144
# File 'lib/htmlcom.rb', line 142

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

Instance Attribute Details

#contentObject

Returns the value of attribute content.



140
141
142
# File 'lib/htmlcom.rb', line 140

def content
  @content
end

#titleObject

Returns the value of attribute title.



140
141
142
# File 'lib/htmlcom.rb', line 140

def title
  @title
end

Instance Method Details

#deleteObject



151
152
153
154
# File 'lib/htmlcom.rb', line 151

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

#to_aObject



161
162
163
# File 'lib/htmlcom.rb', line 161

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