Class: Refinery::Activity
- Inherits:
-
Object
- Object
- Refinery::Activity
- Defined in:
- lib/refinery/activity.rb
Instance Attribute Summary collapse
-
#class ⇒ Object
Returns the value of attribute class.
-
#conditions ⇒ Object
Returns the value of attribute conditions.
-
#created_image ⇒ Object
Returns the value of attribute created_image.
-
#limit ⇒ Object
Returns the value of attribute limit.
-
#nested_with ⇒ Object
Returns the value of attribute nested_with.
-
#order ⇒ Object
Returns the value of attribute order.
-
#title ⇒ Object
Returns the value of attribute title.
-
#updated_image ⇒ Object
Returns the value of attribute updated_image.
-
#url ⇒ Object
Returns the value of attribute url.
-
#url_prefix ⇒ Object
Returns the value of attribute url_prefix.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Activity
constructor
for nested_with, pass in the reverse order of ancestry e.g.
-
#nesting(record_string = "record") ⇒ Object
to use in a URL like edit_admin_group_individuals_url(record.group, record) which will help you if you’re using nested routed.
Constructor Details
#initialize(options = {}) ⇒ Activity
for nested_with, pass in the reverse order of ancestry e.g. [parent.parent_of_parent, parent]
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/refinery/activity.rb', line 7 def initialize(={}) { :class => nil, :conditions => nil, :created_image => "add.png", :limit => 7, :nested_with => [], :order => "updated_at DESC", :title => "title", :updated_image => "edit.png", :url => nil, :url_prefix => "edit" }.merge().each { |key,value| self.instance_variable_set(:"@#{key}", value) } end |
Instance Attribute Details
#class ⇒ Object
Returns the value of attribute class.
4 5 6 |
# File 'lib/refinery/activity.rb', line 4 def class @class end |
#conditions ⇒ Object
Returns the value of attribute conditions.
4 5 6 |
# File 'lib/refinery/activity.rb', line 4 def conditions @conditions end |
#created_image ⇒ Object
Returns the value of attribute created_image.
4 5 6 |
# File 'lib/refinery/activity.rb', line 4 def created_image @created_image end |
#limit ⇒ Object
Returns the value of attribute limit.
4 5 6 |
# File 'lib/refinery/activity.rb', line 4 def limit @limit end |
#nested_with ⇒ Object
Returns the value of attribute nested_with.
4 5 6 |
# File 'lib/refinery/activity.rb', line 4 def nested_with @nested_with end |
#order ⇒ Object
Returns the value of attribute order.
4 5 6 |
# File 'lib/refinery/activity.rb', line 4 def order @order end |
#title ⇒ Object
Returns the value of attribute title.
4 5 6 |
# File 'lib/refinery/activity.rb', line 4 def title @title end |
#updated_image ⇒ Object
Returns the value of attribute updated_image.
4 5 6 |
# File 'lib/refinery/activity.rb', line 4 def updated_image @updated_image end |
#url ⇒ Object
Returns the value of attribute url.
4 5 6 |
# File 'lib/refinery/activity.rb', line 4 def url @url end |
#url_prefix ⇒ Object
Returns the value of attribute url_prefix.
4 5 6 |
# File 'lib/refinery/activity.rb', line 4 def url_prefix @url_prefix end |
Instance Method Details
#nesting(record_string = "record") ⇒ Object
to use in a URL like edit_admin_group_individuals_url(record.group, record) which will help you if you’re using nested routed.
24 25 26 |
# File 'lib/refinery/activity.rb', line 24 def nesting(record_string="record") self.nested_with.inject("") { |nest_chain, nesting| nest_chain << "#{record_string}.#{nesting}," } end |