Module: TokyoMetro::Modules::Common::Info::StationFacility::BarrierFree::WheelChair::MethodMissing

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/tokyo_metro/modules/common/info/station_facility/barrier_free/wheel_chair/method_missing.rb', line 15

def method_missing( method_name , *args )
  if args.empty? and /wheel(?:_?)chair/ === method_name.to_s
    case method_name.to_s
    when /\A(?:(?:is_)?for_)?wheel(?:_)?chair(?:s)?(?:\?)?\Z/
      return wheel_chair_accessible?
    when /\A(?:is_)?wheel(?:_)?chair(?:s)?_accessible(?:\?)?\Z/
      return wheel_chair_accessible?
    when /\A(?:is_)?available_(?:to|for)_wheel(?:_)?chair(?:s)?(?:\?)?\Z/
      return available_to_wheel_chair?
    end
  end

  super
end

Instance Method Details

#available_to_wheel_chair?Boolean

Note:

is_available_to_wheel_chair の別名として、available_to_wheel_chair? を定義

Returns:

  • (Boolean)


11
12
13
# File 'lib/tokyo_metro/modules/common/info/station_facility/barrier_free/wheel_chair/method_missing.rb', line 11

def available_to_wheel_chair?
  is_available_to_wheel_chair
end

#wheel_chair_accessible?Boolean

Note:

wheel_chair_accessible の別名として、wheel_chair_accessible? を定義

Returns:

  • (Boolean)


6
7
8
# File 'lib/tokyo_metro/modules/common/info/station_facility/barrier_free/wheel_chair/method_missing.rb', line 6

def wheel_chair_accessible?
  wheel_chair_accessible
end