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.



129
130
131
# File 'lib/htmlcom.rb', line 129

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

Instance Attribute Details

#contentObject

Returns the value of attribute content.



127
128
129
# File 'lib/htmlcom.rb', line 127

def content
  @content
end

#titleObject

Returns the value of attribute title.



127
128
129
# File 'lib/htmlcom.rb', line 127

def title
  @title
end

Instance Method Details

#deleteObject



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

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

#to_aObject



148
149
150
# File 'lib/htmlcom.rb', line 148

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