Class: Simple2ch::BBS

Inherits:
Object
  • Object
show all
Defined in:
lib/simple2ch/bbs.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type_of_2ch) ⇒ BBS

Returns a new instance of BBS.



11
12
13
14
15
16
17
18
19
# File 'lib/simple2ch/bbs.rb', line 11

def initialize(type_of_2ch)
  case type_of_2ch
  when :sc, :open
    @type_of_2ch = type_of_2ch
  else
    raise %{Invalid "type_of_2ch" given: #{type_of_2ch} (:sc or :open is correct.)}
  end
  @updated_at = Time.now
end

Instance Attribute Details

#boards(force_reload: nil, bbsmenu_url: nil) ⇒ Array<Simple2ch::Board> (readonly)

Returns 板リスト.

Parameters:

  • [Boolean] (Hash)

    a customizable set of options

Returns:



27
28
29
# File 'lib/simple2ch/bbs.rb', line 27

def boards
  @boards
end

#type_of_2chObject (readonly)

Returns the value of attribute type_of_2ch.



9
10
11
# File 'lib/simple2ch/bbs.rb', line 9

def type_of_2ch
  @type_of_2ch
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



9
10
11
# File 'lib/simple2ch/bbs.rb', line 9

def updated_at
  @updated_at
end

Instance Method Details

#rootObject



21
22
23
# File 'lib/simple2ch/bbs.rb', line 21

def root
  File.dirname __dir__
end