Class: Media::Filter::Argument
- Inherits:
-
Object
- Object
- Media::Filter::Argument
- Defined in:
- lib/media/filter/argument.rb
Instance Method Summary collapse
-
#initialize(args) ⇒ Argument
constructor
A new instance of Argument.
- #to_s ⇒ Object
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_s ⇒ Object
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 |