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)


5
6
7
8
9
# File 'lib/syoboi_calendar/resources/program_resource.rb', line 5

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

#commentString?

Returns:

  • (String, nil)


12
13
14
# File 'lib/syoboi_calendar/resources/program_resource.rb', line 12

def comment
  source["ProgComment"]
end

#countInteger?

Returns:

  • (Integer, nil)


17
18
19
20
21
# File 'lib/syoboi_calendar/resources/program_resource.rb', line 17

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

#deleted?Boolean Also known as: deleted

Returns:

  • (Boolean)


24
25
26
# File 'lib/syoboi_calendar/resources/program_resource.rb', line 24

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

#finished_atTime?

Returns:

  • (Time, nil)


30
31
32
33
34
# File 'lib/syoboi_calendar/resources/program_resource.rb', line 30

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

#flagInteger?

Returns:

  • (Integer, nil)


37
38
39
40
41
# File 'lib/syoboi_calendar/resources/program_resource.rb', line 37

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

#idInteger?

Returns:

  • (Integer, nil)


44
45
46
47
48
# File 'lib/syoboi_calendar/resources/program_resource.rb', line 44

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

#iepg_nameString?

Returns:

  • (String, nil)


51
52
53
# File 'lib/syoboi_calendar/resources/program_resource.rb', line 51

def iepg_name
  source["ChiEPGName"]
end

#revisionInteger?

Returns:

  • (Integer, nil)


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

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

#started_atTime?

Returns:

  • (Time, nil)


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

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

#sub_titleString?

Returns:

  • (String, nil)


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

def sub_title
  source["STSubTitle"]
end

#title_idInteger

Returns:

  • (Integer)


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

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

#warnInteger?

Returns:

  • (Integer, nil)


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

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