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
videojuicer-vj-sdk-0.1.12 lib/videojuicer/resource/types.rb
vj-sdk-0.8.2 lib/videojuicer/resource/types.rb
vj-sdk-0.7.14 lib/videojuicer/resource/types.rb
vj-sdk-0.7.13 lib/videojuicer/resource/types.rb
vj-sdk-0.7.11 lib/videojuicer/resource/types.rb
vj-sdk-0.7.10 lib/videojuicer/resource/types.rb
vj-sdk-0.7.9 lib/videojuicer/resource/types.rb
vj-sdk-0.7.8 lib/videojuicer/resource/types.rb
vj-sdk-0.7.7 lib/videojuicer/resource/types.rb
vj-sdk-0.7.6 lib/videojuicer/resource/types.rb
vj-sdk-0.7.5 lib/videojuicer/resource/types.rb
vj-sdk-0.7.4 lib/videojuicer/resource/types.rb
vj-sdk-0.7.3 lib/videojuicer/resource/types.rb
vj-sdk-0.7.2 lib/videojuicer/resource/types.rb
vj-sdk-0.7.1 lib/videojuicer/resource/types.rb
vj-sdk-0.7.0 lib/videojuicer/resource/types.rb
vj-sdk-0.6.9 lib/videojuicer/resource/types.rb
vj-sdk-0.6.8 lib/videojuicer/resource/types.rb
vj-sdk-0.6.7 lib/videojuicer/resource/types.rb
vj-sdk-0.6.5 lib/videojuicer/resource/types.rb