<commit_before>module Videojuicer
  module Asset
    class Base
      
      def self.inherited(base)
        base.send(:include, Videojuicer::Resource)
        base.send(:extend, Videojuicer::Asset::Base::ClassMethods)
        base.send(:include, Videojuicer::Asset::Base::InstanceMethods)
        
        # - heritage
        base.property :derived_internally,  Videojuicer::Resource::Types::Boolean, :writer => :private
        base.property :original_asset_id,   Integer,  :writer => :private
        base.property :original_asset_type, String,   :writer => :private
        base.property :preset_id,           Integer,  :writer => :private
        base.property :user_id,             Integer,  :writer => :private
        
        # - transformation
        base.property :source_space_window, String,   :writer => :private
        base.property :source_time_window,  String,   :writer => :private
        
        # - generic file handling
        base.property :file,                File
        base.property :file_name,           String
        base.property :file_size,           Integer,  :writer => :private # bytes
        
        # - common metadata
        base.property :licensed_at,         Date
        base.property :licensed_by,         String
        base.property :licensed_under,      String
        base.property :published_at,        Date
        
        # - access control / workflow
        base.property :url,                 String,   :writer => :private
        base.property :state,               String,   :writer => :private
        base.property :state_changed_at,    DateTime, :writer => :private
        base.property :state_changed_url,   String
        base.property :created_at,          DateTime
        base.property :updated_at,          DateTime
      end
      
      module ClassMethods
        def singular_name
          "asset"
        end
        
        def base_path(options={})
          "/assets/#{self.to_s.downcase.split("::").last}"
        end
      end
      
      module InstanceMethods
        def derive(preset)
          response = proxy_for(config).post(resource_path, :preset_id => preset.id)
          self.class.new(JSON.parse(response.body))
        end
        
        def file
          raise "use the value of #{self.class}#url to download a copy of the asset"
        end
        
        def returnable_attributes<commit_msg>Added http_url attribute to Asset::Base.<commit_after>module Videojuicer
  module Asset
    class Base
      
      def self.inherited(base)
        base.send(:include, Videojuicer::Resource)
        base.send(:extend, Videojuicer::Asset::Base::ClassMethods)
        base.send(:include, Videojuicer::Asset::Base::InstanceMethods)
        
        # - heritage
        base.property :derived_internally,  Videojuicer::Resource::Types::Boolean, :writer => :private
        base.property :original_asset_id,   Integer,  :writer => :private
        base.property :original_asset_type, String,   :writer => :private
        base.property :preset_id,           Integer,  :writer => :private
        base.property :user_id,             Integer,  :writer => :private
        
        # - transformation
        base.property :source_space_window, String,   :writer => :private
        base.property :source_time_window,  String,   :writer => :private
        
        # - generic file handling
        base.property :file,                File
        base.property :file_name,           String
        base.property :file_size,           Integer,  :writer => :private # bytes
        
        # - common metadata
        base.property :licensed_at,         Date
        base.property :licensed_by,         String
        base.property :licensed_under,      String
        base.property :published_at,        Date
        
        # - access control / workflow
        base.property :url,                 String,   :writer => :private
        base.property :http_url,            String,   :writer => :private
        base.property :state,               String,   :writer => :private
        base.property :state_changed_at,    DateTime, :writer => :private
        base.property :state_changed_url,   String
        base.property :created_at,          DateTime
        base.property :updated_at,          DateTime
      end
      
      module ClassMethods
        def singular_name
          "asset"
        end
        
        def base_path(options={})
          "/assets/#{self.to_s.downcase.split("::").last}"
        end
      end
      
      module InstanceMethods
        def derive(preset)
          response = proxy_for(config).post(resource_path, :preset_id => preset.id)
          self.class.new(JSON.parse(response.body))
        end
        
        def file
          raise "use the value of #{self.class}#url to download a copy of the asset"
        end
        
        def returnable_attributes
{'fraction_non_alphanumeric': 0.09190951701650703, 'fraction_numerical': 0.0, 'mean_word_length': 1.8468677494199537, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2335991', 'n_tokens_mistral': 1285, 'n_tokens_neox': 1279, 'n_words': 302}