### Home Classes Methods

### In Files

- lib/last_fm/validator.rb

### Methods

- ::validate_mash

### Files

- README_FOR_APP

### Class Index

Quicksearch

- LastFM
- LastFM::Album
- LastFM::Artist
- LastFM::Chart
- LastFM::Request
- LastFM::Track
- LastFM::Validator
- DeviseAuth
- DeviseAuth::RegistrationsController
- DeviseAuth::SessionsController
- Users
- Users::OmniauthCallbacksController
- ApplicationController
- ApplicationHelper
- Artist
- ArtistsController
- ChartsController
- HomeController
- Playlist
- PlaylistsTracks
- RedisQueryable
- SearchController
- Track
- TracksController
- User
- UsersController
- UsersHelper
- YoutubeVideoRating

No matching classes.

# LastFM::Validator

### Public Class Methods

validate_mash(mash, *args) click to toggle source

        # File lib/last_fm/validator.rb, line 5
     5:     def self.validate_mash mash, *args

     6:       args.flatten!

     7:

     8:       return [] if mash.blank?

     9:

    10:       mash.each do |key, value|

    11:         if args.include? key.to_s || value.is_a?(Array)

    12:           mash[key] = Array.wrap value

    13:           mash[key].map do |mashie|

    14:             validate_mash mashie, args

    15:           end

    16:         elsif value.is_a? Hashie::Mash

    17:           mash[key] = validate_mash mash[key], args

    18:         end

    19:         mash[key] = "" if value.blank? && value.is_a?(String)

    20:         mash[key] = [] if value.blank? && value.is_a?(Array)

    21:       end

    22:

    23:       return mash

    24:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.