Class: Ld::ParameterError

Inherits:
Object
  • Object
show all
Defined in:
lib/ld/error/parameter_error.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(clazz, hint) ⇒ ParameterError

Returns a new instance of ParameterError.



4
5
6
7
# File 'lib/ld/error/parameter_error.rb', line 4

def initialize clazz, hint
  @clazz = clazz
  @hint = hint
end

Instance Attribute Details

#clazzObject

Returns the value of attribute clazz.



2
3
4
# File 'lib/ld/error/parameter_error.rb', line 2

def clazz
  @clazz
end

#hintObject

Returns the value of attribute hint.



2
3
4
# File 'lib/ld/error/parameter_error.rb', line 2

def hint
  @hint
end

Class Method Details

.create(clazz, &block) ⇒ Object



9
10
11
12
13
# File 'lib/ld/error/parameter_error.rb', line 9

def self.create clazz, &block
  runtime_error = self.new clazz
  block.call runtime_error
  runtime_error
end

Instance Method Details

#add_runObject



15
16
17
# File 'lib/ld/error/parameter_error.rb', line 15

def add_run

end

#raise(hash) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/ld/error/parameter_error.rb', line 19

def raise hash
  lines = []
  case hash[:error_type]
    when :example
      # lines =
    when :scope
      lines = [
          "scope参数说明:",
          "  1 不能为空",
          "  2 格式'单元格1:单元格2',如'A1:B2'代表读取以A1与B2为对角的矩形范围中的所有内容",
      ]
  end

  lines.each{|line| puts line}

end