Class: ContextExposer::Page

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/context_exposer/page.rb,
lib/context_exposer/page/resource.rb

Defined Under Namespace

Classes: Resource

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#actionObject

Returns the value of attribute action.



7
8
9
# File 'lib/context_exposer/page.rb', line 7

def action
  @action
end

#controller_nameObject

Returns the value of attribute controller_name.



7
8
9
# File 'lib/context_exposer/page.rb', line 7

def controller_name
  @controller_name
end

#idObject

Returns the value of attribute id.



7
8
9
# File 'lib/context_exposer/page.rb', line 7

def id
  @id
end

#modeObject

Returns the value of attribute mode.



7
8
9
# File 'lib/context_exposer/page.rb', line 7

def mode
  @mode
end

#nameObject

action= ‘show’, resource.name = ‘post’ and resource.type = :item

show_post_item

action= ‘manage’, resource.name = ‘post’ and resource.type = :list

manage_post_list


27
28
29
# File 'lib/context_exposer/page.rb', line 27

def name
  @name
end

#resourceObject

Returns the value of attribute resource.



7
8
9
# File 'lib/context_exposer/page.rb', line 7

def resource
  @resource
end

#typeObject

Returns the value of attribute type.



7
8
9
# File 'lib/context_exposer/page.rb', line 7

def type
  @type
end

Instance Method Details

#clear!Object



16
17
18
19
20
21
# File 'lib/context_exposer/page.rb', line 16

def clear!
  instance_variables.each do |inst_var|
    var = inst_var.to_s.sub('@', '')
    self.send("#{var}=", nil)
  end
end

#configure(name = nil, options = {}) ⇒ Object



9
10
11
12
13
14
# File 'lib/context_exposer/page.rb', line 9

def configure name = nil, options = {}
  self.name = name
  self.type = options[:type]
  self.resource.name = options[:resource_name]
  self.resource.type = options[:resource_type]
end

#controller=(controller) ⇒ Object



31
32
33
34
# File 'lib/context_exposer/page.rb', line 31

def controller= controller
  @action = controller.action_name
  @controller_name = controller.controller_name    
end

#map?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/context_exposer/page.rb', line 40

def map?
  false
end