Sha256: 7feeccf9a36c9744abf6dfe643a212a6b79f28657bbfebd32923586a6b464287

Contents?: true

Size: 1.04 KB

Versions: 79

Compression:

Stored size: 1.04 KB

Contents

require 'time'

module MPXJ
  # Base class from which all project entities are derived
  class Container
    attr_reader :parent_project
    def initialize(parent_project, attribute_values)
      @parent_project = parent_project
      @attribute_values = attribute_values
    end

    attr_reader :attribute_values

    private

    def get_duration_value(attribute_value)
      if attribute_value.nil?
        0.0
      else
        attribute_value.to_f
      end
    end

    def get_date_value(attribute_value)
      if attribute_value.nil?
        nil
      else
        @parent_project.zone.parse(attribute_value)
      end
    end

    def get_float_value(attribute_value)
      if attribute_value.nil?
        0.0
      else
        attribute_value.to_f
      end
    end

    def get_integer_value(attribute_value)
      if attribute_value.nil?
        0
      else
        attribute_value.to_i
      end
    end

    def get_boolean_value(attribute_value)
      attribute_value == true
    end
  end
end

Version data entries

79 entries across 79 versions & 1 rubygems

Version Path
mpxj-13.6.0 lib/mpxj/container.rb
mpxj-13.5.1 lib/mpxj/container.rb
mpxj-13.5.0 lib/mpxj/container.rb
mpxj-13.4.1 lib/mpxj/container.rb
mpxj-13.4.0 lib/mpxj/container.rb
mpxj-13.3.1 lib/mpxj/container.rb
mpxj-13.3.0 lib/mpxj/container.rb
mpxj-13.2.1 lib/mpxj/container.rb
mpxj-13.2.0 lib/mpxj/container.rb
mpxj-13.1.0 lib/mpxj/container.rb
mpxj-13.0.2 lib/mpxj/container.rb
mpxj-13.0.1 lib/mpxj/container.rb
mpxj-13.0.0 lib/mpxj/container.rb
mpxj-12.10.3 lib/mpxj/container.rb
mpxj-12.10.2 lib/mpxj/container.rb
mpxj-12.9.3 lib/mpxj/container.rb
mpxj-12.9.2 lib/mpxj/container.rb
mpxj-12.9.1 lib/mpxj/container.rb
mpxj-12.9.0 lib/mpxj/container.rb
mpxj-12.8.1 lib/mpxj/container.rb