Class: Fidelity::Widget::Navbar::Item

Inherits:
Object
  • Object
show all
Defined in:
app/fidelity/widgets/navbar/navbar.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type = :default, label = 'Item', content = '') ⇒ Item

Returns a new instance of Item.



41
42
43
44
45
# File 'app/fidelity/widgets/navbar/navbar.rb', line 41

def initialize type=:default, label='Item', content=''
  @type = type
  @label = label || content
  @content = content
end

Instance Attribute Details

#contentObject

Returns the value of attribute content.



40
41
42
# File 'app/fidelity/widgets/navbar/navbar.rb', line 40

def content
  @content
end

#labelObject

Returns the value of attribute label.



40
41
42
# File 'app/fidelity/widgets/navbar/navbar.rb', line 40

def label
  @label
end

#typeObject

Returns the value of attribute type.



40
41
42
# File 'app/fidelity/widgets/navbar/navbar.rb', line 40

def type
  @type
end

Instance Method Details

#flyout?Boolean

Returns:

  • (Boolean)


55
56
57
# File 'app/fidelity/widgets/navbar/navbar.rb', line 55

def flyout?
  @type == :flyout
end

#item?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'app/fidelity/widgets/navbar/navbar.rb', line 47

def item?
  @type == :default
end

#link?Boolean

Returns:

  • (Boolean)


51
52
53
# File 'app/fidelity/widgets/navbar/navbar.rb', line 51

def link?
  @type == :link
end