class Datte::Parser
Constants
- DEFAULT_OPTIONS
Attributes
default_options[W]
locale[W]
Public Class Methods
default_options()
click to toggle source
# File lib/datte/parser.rb, line 15 def default_options @default_options ||= DEFAULT_OPTIONS.dup end
locale()
click to toggle source
# File lib/datte/parser.rb, line 10 def locale @locale || :ja end
new(options = {})
click to toggle source
# File lib/datte/parser.rb, line 20 def initialize(options = {}) @options = self.class.default_options.merge(options) end
Public Instance Methods
parse_date(body) { |date| ... }
click to toggle source
# File lib/datte/parser.rb, line 24 def parse_date(body) body = TextConverter.new().kan_num(body) date = DateParser.new(body).parse p date return yield(date) if block_given? && !date.nil? return date end
to_date()
click to toggle source
# File lib/datte/parser.rb, line 32 def to_date @date end