Class: Meteor::Exception::NoSuchElementException

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

Overview

Element Search Exception (要素検索例外)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tag) ⇒ NoSuchElementException #initialize(attr_name, attr_value) ⇒ NoSuchElementException #initialize(tag, attr_name, attr_value) ⇒ NoSuchElementException #initialize(attr_name1, attr_value1, attr_name2, attr_value2) ⇒ NoSuchElementException #initialize(tag, attr_name1, attr_value1, attr_name2, attr_value2) ⇒ NoSuchElementException

initializer (イニシャライザ)

Overloads:

  • #initialize(tag) ⇒ NoSuchElementException

    Parameters:

    • tag (String, Symbol)

      tag name (タグ名)

  • #initialize(attr_name, attr_value) ⇒ NoSuchElementException

    Parameters:

    • attr_name (String, Symbol)

      attribute name (属性名)

    • attr_value (String)

      attribute value (属性値)

  • #initialize(tag, attr_name, attr_value) ⇒ NoSuchElementException

    Parameters:

    • tag (String, Symbol)

      tag name (タグ名)

    • attr_name (String, Symbol)

      attribute name (属性名)

    • attr_value (String)

      attribute value (属性値)

  • #initialize(attr_name1, attr_value1, attr_name2, attr_value2) ⇒ NoSuchElementException

    Parameters:

    • attr_name1 (String, Symbol)

      attribute name1 (属性名1)

    • attr_value1 (String)

      attribute value1 (属性値1)

    • attr_name2 (String, Symbol)

      attribute name2 (属性名2)

    • attr_value2 (String)

      attribute value2 (属性値2)

  • #initialize(tag, attr_name1, attr_value1, attr_name2, attr_value2) ⇒ NoSuchElementException

    Parameters:

    • tag (String, Symbol)

      tag name (タグ名)

    • attr_name1 (String, Symbol)

      attribute name1 (属性名1)

    • attr_value1 (String)

      attribute value1 (属性値1)

    • attr_name2 (String, Symbol)

      attribute name2 (属性名2)

    • attr_value2 (String)

      attribute value2 (属性値2)


1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
# File 'lib/meteor.rb', line 1372

def initialize(*args)
  case args.length
    when ONE
      initialize_1(args[0])
    when TWO
      initialize_2(args[0], args[1])
    when THREE
      initialize_3(args[0], args[1], args[2])
    when FOUR
      initialize_4(args[0], args[1], args[2], args[3])
    when FIVE
      initialize_5(args[0], args[1], args[2], args[3], args[4])
  end
end

Instance Attribute Details

#messageString

Returns message (メッセージ)

Returns:

  • (String)

    message (メッセージ)


1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
# File 'lib/meteor.rb', line 1345

class NoSuchElementException

  attr_accessor :message

  #
  # initializer (イニシャライザ)
  # @overload initialize(tag)
  #  @param [String,Symbol] tag tag name (タグ名)
  # @overload initialize(attr_name,attr_value)
  #  @param [String,Symbol] attr_name attribute name (属性名)
  #  @param [String] attr_value attribute value (属性値)
  # @overload initialize(tag,attr_name,attr_value)
  #  @param [String,Symbol] tag tag name (タグ名)
  #  @param [String,Symbol] attr_name attribute name (属性名)
  #  @param [String] attr_value attribute value (属性値)
  # @overload initialize(attr_name1,attr_value1,attr_name2,attr_value2)
  #  @param [String,Symbol] attr_name1 attribute name1 (属性名1)
  #  @param [String] attr_value1 attribute value1 (属性値1)
  #  @param [String,Symbol] attr_name2 attribute name2 (属性名2)
  #  @param [String] attr_value2 attribute value2 (属性値2)
  # @overload initialize(tag,attr_name1,attr_value1,attr_name2,attr_value2)
  #  @param [String,Symbol] tag tag name (タグ名)
  #  @param [String,Symbol] attr_name1 attribute name1 (属性名1)
  #  @param [String] attr_value1 attribute value1 (属性値1)
  #  @param [String,Symbol] attr_name2 attribute name2 (属性名2)
  #  @param [String] attr_value2 attribute value2 (属性値2)
  #
  def initialize(*args)
    case args.length
      when ONE
        initialize_1(args[0])
      when TWO
        initialize_2(args[0], args[1])
      when THREE
        initialize_3(args[0], args[1], args[2])
      when FOUR
        initialize_4(args[0], args[1], args[2], args[3])
      when FIVE
        initialize_5(args[0], args[1], args[2], args[3], args[4])
    end
  end

  def initialize_1(tag)
    self.message="element not found : #{tag}"
  end

  private :initialize_1

  def initialize_2(attr_name, attr_value)
    self.message="element not found : [#{attr_name}=#{attr_value}]"
  end

  private :initialize_2

  def initialize_3(tag, attr_name, attr_value)
    self.message="element not found : #{tag}[#{attr_name}=#{attr_value}]"
  end

  private :initialize_3

  def initialize_4(attr_name1, attr_value1, attr_name2, attr_value2)
    self.message="element not found : [#{attr_name1}=#{attr_value1}][#{attr_name2}=#{attr_value2}]"
  end

  private :initialize_4

  def initialize_5(tag, attr_name1, attr_value1, attr_name2, attr_value2)
    self.message="element not found : #{tag}[#{attr_name1}=#{attr_value1}][#{attr_name2}=#{attr_value2}]"
  end

  private :initialize_5

end