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

#revisionInteger?

Returns:

  • (Integer, nil)

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

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

#started_atTime?

Returns:

  • (Time, nil)

65
66
67
68
69
# File 'lib/syoboi_calendar/resources/program_resource.rb', line 65

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

#sub_titleString?

Returns:

  • (String, nil)

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

def sub_title
  source["STSubTitle"]
end

#title_idInteger

Returns:

  • (Integer)

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

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

#warnInteger?

Returns:

  • (Integer, nil)

84
85
86
87
88
# File 'lib/syoboi_calendar/resources/program_resource.rb', line 84

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