Class: ControllerHelper::Partials

Inherits:
Object
  • Object
show all
Defined in:
app/helpers/kit/controller_helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(controller) ⇒ Partials

Returns a new instance of Partials.



9
10
11
# File 'app/helpers/kit/controller_helper.rb', line 9

def initialize controller
  @controller = controller
end

Instance Attribute Details

#controllerObject (readonly)

Returns the value of attribute controller.



7
8
9
# File 'app/helpers/kit/controller_helper.rb', line 7

def controller
  @controller
end

Instance Method Details

#hide(name) ⇒ Object



25
26
27
# File 'app/helpers/kit/controller_helper.rb', line 25

def hide name
  partials.delete name
end

#hide?(name) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'app/helpers/kit/controller_helper.rb', line 17

def hide? name
  !show?(name)
end

#show(name) ⇒ Object



21
22
23
# File 'app/helpers/kit/controller_helper.rb', line 21

def show name
  partials[name] = true
end

#show?(name) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'app/helpers/kit/controller_helper.rb', line 13

def show? name
  partials.include? name
end