Class: SyoboiCalendar::Resources::ProgramResource

Inherits:
BaseResource
  • Object
show all
Defined in:
lib/syoboi_calendar/resources/program_resource.rb

Instance Attribute Summary

Attributes inherited from BaseResource

#source

Instance Method Summary collapse

Methods inherited from BaseResource

#initialize, #updated_at

Constructor Details

This class inherits a constructor from SyoboiCalendar::Resources::BaseResource

Instance Method Details

#channel_idInteger?

Returns:

  • (Integer, nil)


7
8
9
10
11
# File 'lib/syoboi_calendar/resources/program_resource.rb', line 7

def channel_id
  if source["ChID"]
    source["ChID"].to_i
  end
end

#commentString?

Returns:

  • (String, nil)


14
15
16
# File 'lib/syoboi_calendar/resources/program_resource.rb', line 14

def comment
  source["ProgComment"]
end

#countInteger?

Returns:

  • (Integer, nil)


19
20
21
22
23
# File 'lib/syoboi_calendar/resources/program_resource.rb', line 19

def count
  if source["Count"]
    source["Count"].to_i
  end
end

#deleted?Boolean Also known as: deleted

Returns:

  • (Boolean)


26
27
28
# File 'lib/syoboi_calendar/resources/program_resource.rb', line 26

def deleted?
  source["Deleted"] != "0"
end

#finished_atTime?

Returns:

  • (Time, nil)


32
33
34
35
36
# File 'lib/syoboi_calendar/resources/program_resource.rb', line 32

def finished_at
  if source["EdTime"]
    ::Time.parse(source["EdTime"])
  end
end

#flagInteger?

Returns:

  • (Integer, nil)


39
40
41
42
43
# File 'lib/syoboi_calendar/resources/program_resource.rb', line 39

def flag
  if source["Flag"]
    source["Flag"].to_i
  end
end

#idInteger?

Returns:

  • (Integer, nil)


46
47
48
49
50
# File 'lib/syoboi_calendar/resources/program_resource.rb', line 46

def id
  if source["PID"]
    source["PID"].to_i
  end
end

#iepg_nameString?

Returns:

  • (String, nil)


53
54
55
# File 'lib/syoboi_calendar/resources/program_resource.rb', line 53

def iepg_name
  source["ChiEPGName"]
end

#rerun?Boolean

Returns:

  • (Boolean)


58
59
60
# File 'lib/syoboi_calendar/resources/program_resource.rb', line 58

def rerun?
  !flag.nil? && flag & 0b1000 != 0
end

#revisionInteger?

Returns:

  • (Integer, nil)


63
64
65
66
67
# File 'lib/syoboi_calendar/resources/program_resource.rb', line 63

def revision
  if source["Revision"]
    source["Revision"].to_i
  end
end

#started_atTime?

Returns:

  • (Time, nil)


70
71
72
73
74
# File 'lib/syoboi_calendar/resources/program_resource.rb', line 70

def started_at
  if source["StTime"]
    ::Time.parse(source["StTime"])
  end
end

#sub_titleString?

Returns:

  • (String, nil)


77
78
79
# File 'lib/syoboi_calendar/resources/program_resource.rb', line 77

def sub_title
  source["STSubTitle"]
end

#title_idInteger

Returns:

  • (Integer)


82
83
84
85
86
# File 'lib/syoboi_calendar/resources/program_resource.rb', line 82

def title_id
  if source["TID"]
    source["TID"].to_i
  end
end

#warnInteger?

Returns:

  • (Integer, nil)


89
90
91
92
93
# File 'lib/syoboi_calendar/resources/program_resource.rb', line 89

def warn
  if source["Warn"]
    source["Warn"].to_i
  end
end