Class: Entitled::ResourceTitle
Instance Attribute Summary collapse
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(resource_or_string) ⇒ ResourceTitle
constructor
A new instance of ResourceTitle.
- #path_object ⇒ Object
- #resource? ⇒ Boolean
Methods inherited from Title
Constructor Details
#initialize(resource_or_string) ⇒ ResourceTitle
Returns a new instance of ResourceTitle.
70 71 72 73 |
# File 'lib/entitled/entitled.rb', line 70 def initialize resource_or_string @resource = resource_or_string unless resource_or_string.class == String @text = resource_or_string.to_s end |
Instance Attribute Details
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
68 69 70 |
# File 'lib/entitled/entitled.rb', line 68 def resource @resource end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
68 69 70 |
# File 'lib/entitled/entitled.rb', line 68 def text @text end |
Instance Method Details
#path_object ⇒ Object
75 76 77 |
# File 'lib/entitled/entitled.rb', line 75 def path_object @resource if navigable? end |
#resource? ⇒ Boolean
79 80 81 |
# File 'lib/entitled/entitled.rb', line 79 def resource? @resource.present? end |