Sha256: 0173d6c0be645bebbe48deb9b6718ab1ec468bc604cbdd225071ed843b61d768

Contents?: true

Size: 525 Bytes

Versions: 36

Compression:

Stored size: 525 Bytes

Contents

module Videojuicer
  module Resource
    module Types
      
      class Base
        def self.load(value)
          return self.new(value)
        end

        def initialize(value)
          @raw = value
        end
        
        # Returns the source value
        attr_reader :raw
      end
      
      class Boolean < Base
        # Boolean.new("1").dump #=> true
        # Returns the coerced value
        def dump
          [1, "1", "true", "yes"].include?(raw)
        end        
      end
    
    end
  end
end

Version data entries

36 entries across 36 versions & 2 rubygems

Version Path
vj-sdk-0.6.4 lib/videojuicer/resource/types.rb
vj-sdk-0.6.3 lib/videojuicer/resource/types.rb
vj-sdk-0.6.1 lib/videojuicer/resource/types.rb
vj-sdk-0.6.0 lib/videojuicer/resource/types.rb
vj-sdk-0.5.6 lib/videojuicer/resource/types.rb
vj-sdk-0.5.5 lib/videojuicer/resource/types.rb
vj-sdk-0.5.4 lib/videojuicer/resource/types.rb
vj-sdk-0.5.3 lib/videojuicer/resource/types.rb
vj-sdk-0.5.2 lib/videojuicer/resource/types.rb
vj-sdk-0.5.1 lib/videojuicer/resource/types.rb
vj-sdk-0.5.0 lib/videojuicer/resource/types.rb
vj-sdk-0.4.3 lib/videojuicer/resource/types.rb
vj-sdk-0.4.2 lib/videojuicer/resource/types.rb
vj-sdk-0.4.1 lib/videojuicer/resource/types.rb
vj-sdk-0.4.0 lib/videojuicer/resource/types.rb
vj-sdk-0.2.1 lib/videojuicer/resource/types.rb