Better optional parameter integration
Apparently I'm dumb and didn't know about equal signs in parameters.
This commit is contained in:
		
							parent
							
								
									3c54c9a017
								
							
						
					
					
						commit
						d94ff3d36b
					
				
					 1 changed files with 12 additions and 15 deletions
				
			
		| 
						 | 
				
			
			@ -109,12 +109,8 @@ module Ebooks
 | 
			
		|||
    # Get an array of media uris in tweet.
 | 
			
		||||
    # @param size [String] A twitter image size to return. Supported sizes are thumb, small, medium (default), large
 | 
			
		||||
    # @return [Array<String>] image URIs included in tweet
 | 
			
		||||
    def media_uris(*args)
 | 
			
		||||
      # When there's no size given, the default is medium.
 | 
			
		||||
      size = ''
 | 
			
		||||
      # Was one given?
 | 
			
		||||
      unless args.empty?
 | 
			
		||||
        case args[0]
 | 
			
		||||
    def media_uris(size_input = '')
 | 
			
		||||
      case size_input
 | 
			
		||||
      when 'thumb'
 | 
			
		||||
        size = ':thumb'
 | 
			
		||||
      when 'small'
 | 
			
		||||
| 
						 | 
				
			
			@ -123,7 +119,8 @@ module Ebooks
 | 
			
		|||
        size = ':medium'
 | 
			
		||||
      when 'large'
 | 
			
		||||
        size = ':large'
 | 
			
		||||
        end
 | 
			
		||||
      else
 | 
			
		||||
        size = ''
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      # Start collecting uris.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue