Sha256: f828d2e17b96daaa76eea6a081772031b92e6ae7091371a4d2ac0a25795f463d
Contents?: true
Size: 507 Bytes
Versions: 10
Compression:
Stored size: 507 Bytes
Contents
module Adva module View class Tabs < Array class Tab attr_reader :tabs, :name def initialize(tabs, name) @tabs = tabs @name = name end def active? self == tabs.first end def blocks @blocks ||= [] end end def tab(name, &block) tab = detect { |tab| tab.name == name } self << tab = Tab.new(self, name) unless tab tab.blocks << block end end end end
Version data entries
10 entries across 10 versions & 1 rubygems