Class: Aerogel::Admin::TabsBuilder::Tab

Inherits:
Object
  • Object
show all
Defined in:
lib/aerogel/admin/tabs_builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, options = {}, &block) ⇒ Tab

Returns a new instance of Tab.



46
47
48
49
50
51
# File 'lib/aerogel/admin/tabs_builder.rb', line 46

def initialize( url, options = {}, &block )
  self.url = url
  self.options = options
  self.label = self.options[:label] || self.url
  self.block = block
end

Instance Attribute Details

#blockObject

Returns the value of attribute block.



44
45
46
# File 'lib/aerogel/admin/tabs_builder.rb', line 44

def block
  @block
end

#labelObject

Returns the value of attribute label.



44
45
46
# File 'lib/aerogel/admin/tabs_builder.rb', line 44

def label
  @label
end

#optionsObject

Returns the value of attribute options.



44
45
46
# File 'lib/aerogel/admin/tabs_builder.rb', line 44

def options
  @options
end

#urlObject

Returns the value of attribute url.



44
45
46
# File 'lib/aerogel/admin/tabs_builder.rb', line 44

def url
  @url
end

Instance Method Details

#human_labelObject



53
54
55
56
57
58
59
60
61
# File 'lib/aerogel/admin/tabs_builder.rb', line 53

def human_label
  if label.is_a? String
    label
  elsif label.is_a? Symbol
    I18n.t label
  else
    label.humanize
  end
end