Class: BibSonomy::Post
- Inherits:
-
Object
- Object
- BibSonomy::Post
- Defined in:
- lib/bibsonomy/post.rb
Instance Attribute Summary collapse
-
#booktitle ⇒ Object
readonly
Returns the value of attribute booktitle.
-
#entrytype ⇒ Object
readonly
Returns the value of attribute entrytype.
-
#groups ⇒ Object
readonly
Returns the value of attribute groups.
-
#intra_hash ⇒ Object
readonly
Returns the value of attribute intra_hash.
-
#journal ⇒ Object
readonly
Returns the value of attribute journal.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#user_name ⇒ Object
readonly
Returns the value of attribute user_name.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Instance Method Summary collapse
-
#initialize(post) ⇒ Post
constructor
A new instance of Post.
Constructor Details
#initialize(post) ⇒ Post
Returns a new instance of Post.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/bibsonomy/post.rb', line 8 def initialize(post) publication = post["bibtex"] @user_name = post["user"]["name"] @intra_hash = publication["intrahash"] @title = publication["title"] @year = publication["year"] @entrytype = publication["entrytype"] @booktitle = publication["booktitle"] @journal = publication["journal"] @url = publication["url"] # extract group names @groups = [] post["group"].each do |group| @groups << group["name"] end end |
Instance Attribute Details
#booktitle ⇒ Object (readonly)
Returns the value of attribute booktitle.
6 7 8 |
# File 'lib/bibsonomy/post.rb', line 6 def booktitle @booktitle end |
#entrytype ⇒ Object (readonly)
Returns the value of attribute entrytype.
6 7 8 |
# File 'lib/bibsonomy/post.rb', line 6 def entrytype @entrytype end |
#groups ⇒ Object (readonly)
Returns the value of attribute groups.
6 7 8 |
# File 'lib/bibsonomy/post.rb', line 6 def groups @groups end |
#intra_hash ⇒ Object (readonly)
Returns the value of attribute intra_hash.
6 7 8 |
# File 'lib/bibsonomy/post.rb', line 6 def intra_hash @intra_hash end |
#journal ⇒ Object (readonly)
Returns the value of attribute journal.
6 7 8 |
# File 'lib/bibsonomy/post.rb', line 6 def journal @journal end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
6 7 8 |
# File 'lib/bibsonomy/post.rb', line 6 def title @title end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
6 7 8 |
# File 'lib/bibsonomy/post.rb', line 6 def url @url end |
#user_name ⇒ Object (readonly)
Returns the value of attribute user_name.
6 7 8 |
# File 'lib/bibsonomy/post.rb', line 6 def user_name @user_name end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
6 7 8 |
# File 'lib/bibsonomy/post.rb', line 6 def year @year end |