Class: Net::NNTP::Group

Inherits:
Object
  • Object
show all
Defined in:
lib/net/nntp/group.rb

Defined Under Namespace

Classes: Articles

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Group

Returns a new instance of Group.



9
10
11
12
13
14
# File 'lib/net/nntp/group.rb', line 9

def initialize(name)
  @name = name
  @articles ||= Articles.new(self)
  #@articles.group = self
  @article_first = @article_last = @article_count = nil
end

Instance Attribute Details

#article_countObject (readonly)

Returns the value of attribute article_count.



6
7
8
# File 'lib/net/nntp/group.rb', line 6

def article_count
  @article_count
end

#article_firstObject (readonly)

Returns the value of attribute article_first.



6
7
8
# File 'lib/net/nntp/group.rb', line 6

def article_first
  @article_first
end

#article_lastObject (readonly)

Returns the value of attribute article_last.



6
7
8
# File 'lib/net/nntp/group.rb', line 6

def article_last
  @article_last
end

#hiObject (readonly)

Returns the value of attribute hi.



7
8
9
# File 'lib/net/nntp/group.rb', line 7

def hi
  @hi
end

#loObject (readonly)

Returns the value of attribute lo.



7
8
9
# File 'lib/net/nntp/group.rb', line 7

def lo
  @lo
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/net/nntp/group.rb', line 6

def name
  @name
end

#postingmodeObject (readonly)

Returns the value of attribute postingmode.



7
8
9
# File 'lib/net/nntp/group.rb', line 7

def postingmode
  @postingmode
end

Instance Method Details

#article_info=(art_array) ⇒ Object

Set article_count, article_first, article_last (from GROUP command)

Takes an array [count, first, last] as argument



19
20
21
22
23
# File 'lib/net/nntp/group.rb', line 19

def (art_array)
  @article_count = art_array[0].to_i
  @article_first = art_array[1].to_i
  @article_last = art_array[2].to_i
end

#articlesObject



25
26
27
# File 'lib/net/nntp/group.rb', line 25

def articles
  @articles
end

#articles=(articles) ⇒ Object



29
30
31
# File 'lib/net/nntp/group.rb', line 29

def articles=(articles)
  @articles = articles
end

#inspectObject



40
41
42
# File 'lib/net/nntp/group.rb', line 40

def inspect
"Group: #{@name}  #{@article_count} #{@article_first} #{@article_last}"
end

#listinfo(hi, lo, postingmode) ⇒ Object

Sets hi and lo watermark alont with postingmode (from LIST ACTIVE command)



34
35
36
37
38
# File 'lib/net/nntp/group.rb', line 34

def listinfo(hi, lo, postingmode)
  @hi = hi
  @lo = lo
  @postingmode = postingmode
end