Class: InlineForms::Tabs::Builder

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

Overview

Abstract builder API (initialize signature is part of the contract: custom builders from either this module or the old gem are duck-typed against it).

Direct Known Subclasses

TabsBuilder

Instance Method Summary collapse

Constructor Details

#initialize(context, options = {}) ⇒ Builder

Returns a new instance of Builder.



133
134
135
136
137
# File 'lib/inline_forms/tabs.rb', line 133

def initialize(context, options = {})
  @context   = context
  @namespace = options.delete(:namespace) || :default
  @options   = options
end

Instance Method Details

#close_tabs(*args) ⇒ Object



149
# File 'lib/inline_forms/tabs.rb', line 149

def close_tabs(*args); end

#current_tab?(tab) ⇒ Boolean

Returns:

  • (Boolean)


139
140
141
# File 'lib/inline_forms/tabs.rb', line 139

def current_tab?(tab)
  tab.to_s == @context.current_tab(@namespace).to_s
end

#open_tabs(*args) ⇒ Object



147
# File 'lib/inline_forms/tabs.rb', line 147

def open_tabs(*args); end

#tab_for(*args) ⇒ Object

Raises:

  • (NotImplementedError)


143
144
145
# File 'lib/inline_forms/tabs.rb', line 143

def tab_for(*args)
  raise NotImplementedError
end