Sha256: 2fdcba12aeacfcad3144f329de0b492ecf8645eb60678286b21c67450cc2d820

Contents?: true

Size: 410 Bytes

Versions: 7

Compression:

Stored size: 410 Bytes

Contents

module MeducationSDK
  class Resource < Loquor::Resource
    def created_at
      DateTime.parse(@data[:created_at])
    end

    def updated_at
      DateTime.parse(@data[:updated_at])
    end

    def class_for(meducation_type)
      case meducation_type
      when "Item::Comment"
        Comment
      else
        "MeducationSDK::#{meducation_type.gsub("::", "")}".constantize
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
meducation_sdk-1.5.7 lib/meducation_sdk/resource.rb
meducation_sdk-1.5.6 lib/meducation_sdk/resource.rb
meducation_sdk-1.5.5 lib/meducation_sdk/resource.rb
meducation_sdk-1.5.4 lib/meducation_sdk/resource.rb
meducation_sdk-1.5.3 lib/meducation_sdk/resource.rb
meducation_sdk-1.5.2 lib/meducation_sdk/resource.rb
meducation_sdk-1.5.1 lib/meducation_sdk/resource.rb