Class: Grendel::Link
- Inherits:
-
Object
- Object
- Grendel::Link
- Defined in:
- lib/grendel/link.rb
Instance Attribute Summary collapse
-
#document ⇒ Object
Returns the value of attribute document.
-
#uri ⇒ Object
Returns the value of attribute uri.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(document, user, params = {}) ⇒ Link
constructor
A new instance of Link.
Constructor Details
#initialize(document, user, params = {}) ⇒ Link
Returns a new instance of Link.
5 6 7 8 9 10 11 12 |
# File 'lib/grendel/link.rb', line 5 def initialize(document, user, params = {}) params = Mash.new(params) @document = document @user = user @uri = params[:uri] ? URI.parse(params[:uri]).path : "/links/" + @user.id # escape this? end |
Instance Attribute Details
#document ⇒ Object
Returns the value of attribute document.
3 4 5 |
# File 'lib/grendel/link.rb', line 3 def document @document end |
#uri ⇒ Object
Returns the value of attribute uri.
3 4 5 |
# File 'lib/grendel/link.rb', line 3 def uri @uri end |
#user ⇒ Object
Returns the value of attribute user.
3 4 5 |
# File 'lib/grendel/link.rb', line 3 def user @user end |