Class: Media::Filter::Argument

Inherits:
Object
  • Object
show all
Defined in:
lib/media/filter/argument.rb

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Argument

Returns a new instance of Argument.



4
5
6
7
# File 'lib/media/filter/argument.rb', line 4

def initialize(args)
  @key   = args.fetch(:key)
  @value = args.fetch(:value, true)
end

Instance Method Details

#to_sObject



9
10
11
12
13
14
# File 'lib/media/filter/argument.rb', line 9

def to_s
  case @value
  when TrueClass, FalseClass then @key.to_s
  else                "#{@key}=#{value}"
  end
end