lib/navi/navigator/instance_methods.rb in navi-0.0.13 vs lib/navi/navigator/instance_methods.rb in navi-0.0.14
- old
+ new
@@ -6,12 +6,12 @@
return db_value if db_value
return navigable.send navigable_config(:label) if navigable && navigable_config(:label)
nil
end
- def link
- db_value = self.read_attribute :link
+ def url
+ db_value = self.read_attribute :url
return db_value if db_value
return navigable if navigable
nil
end
@@ -19,39 +19,39 @@
db_value = self.read_attribute :title
return db_value if db_value
if navigable && navigable_config(:title)
config = navigable_config :title
return case config
- when Symbol then navigable.send config
- when String then config
- when Proc then config.call navigable
+ when Symbol then navigable.send config
+ when String then config
+ when Proc then config.call navigable
+ end
end
+ return self.label
end
- return self.label
- end
- def highlights_on
- db_value = self.read_attribute :highlights_on
- value = if db_value
- Regexp.new db_value
- else # db_value.nil?
- if navigable && navigable_config(:highlights_on)
- config = navigable_config(:highlights_on)
- case config
- when Proc then config.call navigable
- else config
+ def highlights_on
+ db_value = self.read_attribute :highlights_on
+ value = if db_value
+ Regexp.new db_value
+ else # db_value.nil?
+ if navigable && navigable_config(:highlights_on)
+ config = navigable_config(:highlights_on)
+ case config
+ when Proc then config.call navigable
+ else config
+ end
+ else
+ self.url
end
- else
- self.link
end
- end
- end
+ end
- private
+ private
- def navigable_config(key)
- navigable.class.navigable_config[key]
- end
+ def navigable_config(key)
+ navigable.class.navigable_config[key]
+ end
+ end
end
-end
end