Sha256: 22fd7eae32f44ff1dc164bf6e49a29d371a0ee5dc0507fcd8905e8afea0de176

Contents?: true

Size: 480 Bytes

Versions: 1

Compression:

Stored size: 480 Bytes

Contents

class TokyoMetro::Factory::Decorate::MetaClass < RailsDecorateFactory

  [ :railway_line , :station , :survey_year ].each do | method_base_name |
    eval <<-DEF
      def #{ method_base_name }_of( url )
        begin
          recognize_path( url )[ :#{ method_base_name } ]
        rescue ::ActionController::RoutingError
          nil
        end
      end

      def current_#{ method_base_name }
        current_position( :#{ method_base_name } )
      end
    DEF
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tokyo_metro-0.10.1 lib/tokyo_metro/factory/decorate/meta_class.rb