Class RDmember
In: rdstyle.rb
Parent: Object

RDmember

タイトル一覧の個々のタイトル情報を保持するクラス

Methods

folder_name   is_folder?   new   set_folder   setdata   time   to_csv  

Attributes

ch  [RW]  チャンネル
date  [RW]  日付
genre  [RW]  ジャンル
no  [RW]  番号
protect  [RW]  保護非保護
src  [RW]  ソース
title  [RW]  タイトル
uri  [RW]  チャプターページのuri
zokusei  [RW]  属性

Public Class methods

空で初期化する

[Source]

# File rdstyle.rb, line 381
  def initialize()
    @src = nil      #dvd/hdd    c0

    @no = nil       #番号       c1

    @title = nil    #タイトル   c2

    @ch = nil       #チャンネル c3

    @date = nil     #日付       c4

    @genre = nil    #ジャンル   c5

    @protect = nil  #保護       c6

    @zokusei = nil  #属性       c13

    @uri = nil
    @folder = nil
  end

Public Instance methods

フォルダー名を返す

[Source]

# File rdstyle.rb, line 430
  def folder_name
    return (@folder ? @folder.title : "root")
  end

フォルダの場合trueを返す

[Source]

# File rdstyle.rb, line 425
  def is_folder?
    return (@zokusei =~ /folder/)
  end

親フォルダをセットする

[Source]

# File rdstyle.rb, line 420
  def set_folder(input_folder)
    @folder = input_folder
  end

データをセットする dataはjavascriptの引数

[Source]

# File rdstyle.rb, line 396
  def setdata(data)
    @data = data
    @src   = c(1)
    @no    = c(2).to_i
    @title = c(3).gsub(/<[^>]*>/, "")
    @ch    = c(4)
    @date  = c(5)
    @genre = c(6)
    @protect = c(7)
    #属性とuri フォルダとそれ以外で違う処理に

    iconfile = c(13)

    if iconfile =~ /^S_|folder|trash/i 
      @uri = "b_title.htm?disc=" + c(10) + "&folder=" + c(8)
      @zokusei = (iconfile =~ /trash/i ? "folder_trash" : "folder")
    else
      @uri = "b_chpt.htm?Title_No=" + c(8) + "&Title_type=" + c(9) + 
        "&Target_drive=" + c(10) + "&Disp_No=" + c(11)
      @zokusei = (iconfile =~ /original/i ? "original" : "playlist")
    end

  end

Time.strftime (年/月/日のみ 時刻は0)を返す

[Source]

# File rdstyle.rb, line 435
  def time
    return Time.local(@date[0, 4].to_i, @date[5, 2].to_i, @date[8, 2].to_i)
  end

csv形式のテキストを返す

[Source]

# File rdstyle.rb, line 440
  def to_csv
    [@src, @zokusei, @no.to_s, @title, @ch, @date, @genre, @protect, 
      folder_name].join(",") + "\n"
  end

[Validate]