Class: ContextExposer::Page
- Inherits:
-
Object
- Object
- ContextExposer::Page
- Includes:
- Singleton
- Defined in:
- lib/context_exposer/page.rb,
lib/context_exposer/page/resource.rb
Defined Under Namespace
Classes: Resource
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#controller_name ⇒ Object
Returns the value of attribute controller_name.
-
#id ⇒ Object
Returns the value of attribute id.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#name ⇒ Object
action= ‘show’, resource.name = ‘post’ and resource.type = :item show_post_item action= ‘manage’, resource.name = ‘post’ and resource.type = :list manage_post_list.
-
#resource ⇒ Object
Returns the value of attribute resource.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #clear! ⇒ Object
- #configure(name = nil, options = {}) ⇒ Object
- #controller=(controller) ⇒ Object
- #map? ⇒ Boolean
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
7 8 9 |
# File 'lib/context_exposer/page.rb', line 7 def action @action end |
#controller_name ⇒ Object
Returns the value of attribute controller_name.
7 8 9 |
# File 'lib/context_exposer/page.rb', line 7 def controller_name @controller_name end |
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/context_exposer/page.rb', line 7 def id @id end |
#mode ⇒ Object
Returns the value of attribute mode.
7 8 9 |
# File 'lib/context_exposer/page.rb', line 7 def mode @mode end |
#name ⇒ Object
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 |
#resource ⇒ Object
Returns the value of attribute resource.
7 8 9 |
# File 'lib/context_exposer/page.rb', line 7 def resource @resource end |
#type ⇒ Object
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, = {} self.name = name self.type = [:type] self.resource.name = [:resource_name] self.resource.type = [: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
40 41 42 |
# File 'lib/context_exposer/page.rb', line 40 def map? false end |