Class: Media::Option
- Inherits:
-
Object
- Object
- Media::Option
- Defined in:
- lib/media/option.rb
Instance Method Summary collapse
-
#initialize(args) ⇒ Option
constructor
A new instance of Option.
- #to_s ⇒ Object
Constructor Details
#initialize(args) ⇒ Option
Returns a new instance of Option.
3 4 5 6 |
# File 'lib/media/option.rb', line 3 def initialize(args) @key = args.fetch(:key) @value = args.fetch(:value, true) end |
Instance Method Details
#to_s ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/media/option.rb', line 8 def to_s case @value when TrueClass then "-#{@key}" when FalseClass then "-no#{@key}" else "-#{@key} #{@value}" end end |