Class: BibSonomy::Post

Inherits:
Object
  • Object
show all
Defined in:
lib/bibsonomy/post.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#booktitleObject (readonly)

Returns the value of attribute booktitle.



6
7
8
# File 'lib/bibsonomy/post.rb', line 6

def booktitle
  @booktitle
end

#entrytypeObject (readonly)

Returns the value of attribute entrytype.



6
7
8
# File 'lib/bibsonomy/post.rb', line 6

def entrytype
  @entrytype
end

#groupsObject (readonly)

Returns the value of attribute groups.



6
7
8
# File 'lib/bibsonomy/post.rb', line 6

def groups
  @groups
end

#intra_hashObject (readonly)

Returns the value of attribute intra_hash.



6
7
8
# File 'lib/bibsonomy/post.rb', line 6

def intra_hash
  @intra_hash
end

#journalObject (readonly)

Returns the value of attribute journal.



6
7
8
# File 'lib/bibsonomy/post.rb', line 6

def journal
  @journal
end

#titleObject (readonly)

Returns the value of attribute title.



6
7
8
# File 'lib/bibsonomy/post.rb', line 6

def title
  @title
end

#urlObject (readonly)

Returns the value of attribute url.



6
7
8
# File 'lib/bibsonomy/post.rb', line 6

def url
  @url
end

#user_nameObject (readonly)

Returns the value of attribute user_name.



6
7
8
# File 'lib/bibsonomy/post.rb', line 6

def user_name
  @user_name
end

#yearObject (readonly)

Returns the value of attribute year.



6
7
8
# File 'lib/bibsonomy/post.rb', line 6

def year
  @year
end