Class: Merrymenu::Tab

Inherits:
Object
  • Object
show all
Defined in:
lib/merrymenu/builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Tab.



58
59
60
61
62
63
64
65
66
# File 'lib/merrymenu/builder.rb', line 58

def initialize(name, url, options={})
  options = options.symbolize_keys.reverse_merge!(:roles => nil, :class => '', :exact_match => false)
  @name = name
  @url = url
  @roles = options[:roles]
  classes = options[:class].is_a?(Array) ? options[:class] : options[:class].split(' ')
  @class_name = (['tab'] + classes).join(' ')
  @exact_match = options[:exact_match]
end

Instance Attribute Details

#class_nameObject

Returns the value of attribute class_name.



56
57
58
# File 'lib/merrymenu/builder.rb', line 56

def class_name
  @class_name
end

#exact_matchObject

Returns the value of attribute exact_match.



56
57
58
# File 'lib/merrymenu/builder.rb', line 56

def exact_match
  @exact_match
end

#nameObject

Returns the value of attribute name.



56
57
58
# File 'lib/merrymenu/builder.rb', line 56

def name
  @name
end

#rolesObject

Returns the value of attribute roles.



56
57
58
# File 'lib/merrymenu/builder.rb', line 56

def roles
  @roles
end

#urlObject

Returns the value of attribute url.



56
57
58
# File 'lib/merrymenu/builder.rb', line 56

def url
  @url
end