Class: Ryodo::SuffixList
- Inherits:
-
Object
- Object
- Ryodo::SuffixList
- Extended by:
- Forwardable
- Defined in:
- lib/ryodo/suffix_list.rb
Instance Attribute Summary collapse
-
#suffix_data ⇒ Object
(also: #list)
readonly
Returns the value of attribute suffix_data.
Class Method Summary collapse
- .instance ⇒ Object
-
.reload(suffix_file = Ryodo::PUBLIC_SUFFIX_STORE) ⇒ Object
rubocop:enable Style/MethodName.
-
.SuffixList(suffix_file = Ryodo::PUBLIC_SUFFIX_STORE) ⇒ Object
rubocop:disable Style/MethodName.
Instance Method Summary collapse
-
#initialize(suffix_file = Ryodo::PUBLIC_SUFFIX_STORE) ⇒ SuffixList
constructor
A new instance of SuffixList.
- #inspect ⇒ Object
- #load_file(suffix_file = Ryodo::PUBLIC_SUFFIX_STORE) ⇒ Object
- #parse_data ⇒ Object
Constructor Details
#initialize(suffix_file = Ryodo::PUBLIC_SUFFIX_STORE) ⇒ SuffixList
Returns a new instance of SuffixList.
7 8 9 |
# File 'lib/ryodo/suffix_list.rb', line 7 def initialize(suffix_file = Ryodo::PUBLIC_SUFFIX_STORE) load_file(suffix_file) end |
Instance Attribute Details
#suffix_data ⇒ Object (readonly) Also known as: list
Returns the value of attribute suffix_data.
5 6 7 |
# File 'lib/ryodo/suffix_list.rb', line 5 def suffix_data @suffix_data end |
Class Method Details
.instance ⇒ Object
39 40 41 |
# File 'lib/ryodo/suffix_list.rb', line 39 def instance @instance ||= new end |
.reload(suffix_file = Ryodo::PUBLIC_SUFFIX_STORE) ⇒ Object
rubocop:enable Style/MethodName
35 36 37 |
# File 'lib/ryodo/suffix_list.rb', line 35 def reload(suffix_file = Ryodo::PUBLIC_SUFFIX_STORE) instance.load_file(suffix_file) && true end |
.SuffixList(suffix_file = Ryodo::PUBLIC_SUFFIX_STORE) ⇒ Object
rubocop:disable Style/MethodName
30 31 32 |
# File 'lib/ryodo/suffix_list.rb', line 30 def SuffixList(suffix_file = Ryodo::PUBLIC_SUFFIX_STORE) instance(suffix_file) end |
Instance Method Details
#inspect ⇒ Object
22 23 24 |
# File 'lib/ryodo/suffix_list.rb', line 22 def inspect "#<#{self.class} FILE:#{@suffix_file} ENTRIES:#{@suffix_data.size}>" end |
#load_file(suffix_file = Ryodo::PUBLIC_SUFFIX_STORE) ⇒ Object
15 16 17 18 |
# File 'lib/ryodo/suffix_list.rb', line 15 def load_file(suffix_file = Ryodo::PUBLIC_SUFFIX_STORE) @suffix_file = suffix_file @suffix_data = parse_data << ["example"] end |
#parse_data ⇒ Object
11 12 13 |
# File 'lib/ryodo/suffix_list.rb', line 11 def parse_data File.readlines(@suffix_file).map { |line| line.strip.split(".") } end |