Sha256: 10ecd4695fc6e219d12a2b0162f06b4e70e06028ba6464fb6743769e66eef92a

Contents?: true

Size: 942 Bytes

Versions: 2

Compression:

Stored size: 942 Bytes

Contents

module Kooaba

  class Item

    attr_accessor :uuid
    attr_accessor :images_sha1

    attr_accessor :title
    attr_accessor :metadata
    attr_accessor :enabled
    attr_accessor :reference_id
    attr_accessor :image_files
    attr_accessor :locale
    attr_accessor :kind

    def initialize(options = {})
      raise TypeError, "enabled should be true or false" unless [nil, true, false].include? options[:enabled]
      if !options[:image_files].instance_of?(Array) && options[:image_files] != nil
        raise TypeError, "image_files must be a list of paths (Array of Strings)"
      end

      @title        = options[:title]
      @metadata     = options[:metadata]
      @enabled      = options[:enabled] == nil ? true : options[:enabled]
      @reference_id = options[:reference_id]
      @image_files  = options[:image_files] || []
      @locale       = options[:locale]
      @kind         = options[:kind]
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
kooaba-0.0.7 lib/kooaba/item.rb
kooaba-0.0.6 lib/kooaba/item.rb