syoboi_calendar 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 50554d60ab1f6b9126cddd8c514a5ce17cddd1d5
4
- data.tar.gz: 73028865860075ea3775b7859087d9240348425c
3
+ metadata.gz: f8e7e291cadddba7e19e3c12ef2da1c9dfb88318
4
+ data.tar.gz: d7dfa63fb7d1c668f9fc0f0f5a2589d460bb56d0
5
5
  SHA512:
6
- metadata.gz: 7bde1d4555f62fe9d7487b2dcf41541be301987a4cfbc43d49f43b1f2aa378930be477a64653a3401ede2999f693a3c3d663735faa657b42fb1e465562fd1528
7
- data.tar.gz: f76685ba60c5b079b755711d47d255df64d93963092335088f497136e8304aa464cb670442be95ae07a17065c355ff5837eba9197e3e70009fff618ebf79faaa
6
+ metadata.gz: 6cf08bd1ff43c00b1ac567b9aae38a42916ec61c5d3103c257d8c7daf98661d82a07652de23f78bc7d6c098cf92762876df45e8baa53d403f2d65afd626598dd
7
+ data.tar.gz: c21d3ed5133df5787b4c280190665a5ea21f75198f3b675eae205bdc3a0c842d5b6546692e73b71a61484ecde856040dd9236ad9323d64cb2ea85a4bd889515a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 0.7.0
2
+
3
+ - Reveal `BaseResource#source`
4
+ - Rename `TitleResource#rank` to `TitleResource#user_point_rank`
5
+ - Rename `TitleResource#point` to `TitleResource#user_point`
6
+ - Rename `ChannelGroupResource#order_score` to `ChannelGroupResource#order`
7
+
1
8
  ## 0.6.1
2
9
 
3
10
  - Separate response and response parser
data/README.md CHANGED
@@ -280,10 +280,10 @@ client.list_channel_groups.first.name
280
280
 
281
281
  </details>
282
282
 
283
- ### SyoboiCalendar::Resources::ChannelGroupResource#order_score
283
+ ### SyoboiCalendar::Resources::ChannelGroupResource#order
284
284
 
285
285
  ```ruby
286
- client.list_channel_groups.first.order_score
286
+ client.list_channel_groups.first.order
287
287
  ```
288
288
 
289
289
  <details>
@@ -790,62 +790,62 @@ client.list_titles(title_id: 1).first.name
790
790
 
791
791
  </details>
792
792
 
793
- ### SyoboiCalendar::Resources::TitleResource#point
793
+ ### SyoboiCalendar::Resources::TitleResource#short_title
794
794
 
795
795
  ```ruby
796
- client.list_titles(title_id: 1).first.point
796
+ client.list_titles(title_id: 4).first.short_title
797
797
  ```
798
798
 
799
799
  <details>
800
800
  <summary>Result</summary>
801
801
 
802
802
  ```ruby
803
- 4
803
+ "ワンダバスタイル"
804
804
  ```
805
805
 
806
806
  </details>
807
807
 
808
- ### SyoboiCalendar::Resources::TitleResource#rank
808
+ ### SyoboiCalendar::Resources::TitleResource#sub_titles
809
809
 
810
810
  ```ruby
811
- client.list_titles(title_id: 1).first.rank
811
+ client.list_titles(title_id: 1).first.sub_titles
812
812
  ```
813
813
 
814
814
  <details>
815
815
  <summary>Result</summary>
816
816
 
817
817
  ```ruby
818
- 2825
818
+ "*001*夕焼けと鉄骨・前編\n*002*夕焼けと鉄骨・後編\n*003*最高のニュース\n*004*夏の夜と魔法遣い\n*005*エプロンとシャンパン\n*006*魔法遣いになりたい\n*007*魔法遣いになれなかっ た魔法遣い\n*008*恋のバカヂカラ\n*009*ユメと少女と夏の種\n*010*魔法の行方\n*011*折れてしまった虹\n*012*魔法遣いに大切なこと"
819
819
  ```
820
820
 
821
821
  </details>
822
822
 
823
- ### SyoboiCalendar::Resources::TitleResource#short_title
823
+ ### SyoboiCalendar::Resources::TitleResource#user_point
824
824
 
825
825
  ```ruby
826
- client.list_titles(title_id: 4).first.short_title
826
+ client.list_titles(title_id: 1).first.user_point
827
827
  ```
828
828
 
829
829
  <details>
830
830
  <summary>Result</summary>
831
831
 
832
832
  ```ruby
833
- "ワンダバスタイル"
833
+ 4
834
834
  ```
835
835
 
836
836
  </details>
837
837
 
838
- ### SyoboiCalendar::Resources::TitleResource#sub_titles
838
+ ### SyoboiCalendar::Resources::TitleResource#user_point_rank
839
839
 
840
840
  ```ruby
841
- client.list_titles(title_id: 1).first.sub_titles
841
+ client.list_titles(title_id: 1).first.user_point_rank
842
842
  ```
843
843
 
844
844
  <details>
845
845
  <summary>Result</summary>
846
846
 
847
847
  ```ruby
848
- "*001*夕焼けと鉄骨・前編\n*002*夕焼けと鉄骨・後編\n*003*最高のニュース\n*004*夏の夜と魔法遣い\n*005*エプロンとシャンパン\n*006*魔法遣いになりたい\n*007*魔法遣いになれなかっ た魔法遣い\n*008*恋のバカヂカラ\n*009*ユメと少女と夏の種\n*010*魔法の行方\n*011*折れてしまった虹\n*012*魔法遣いに大切なこと"
848
+ 2825
849
849
  ```
850
850
 
851
851
  </details>
@@ -1,6 +1,9 @@
1
1
  module SyoboiCalendar
2
2
  module Resources
3
3
  class BaseResource
4
+ # @return [Hash]
5
+ attr_reader :source
6
+
4
7
  # @param source [Hash]
5
8
  def initialize(source)
6
9
  @source = source
@@ -12,13 +15,6 @@ module SyoboiCalendar
12
15
  ::Time.parse(source["LastUpdate"])
13
16
  end
14
17
  end
15
-
16
- private
17
-
18
- # @return [Hash]
19
- def source
20
- @source
21
- end
22
18
  end
23
19
  end
24
20
  end
@@ -19,7 +19,7 @@ module SyoboiCalendar
19
19
  end
20
20
 
21
21
  # @return [Integer, nil]
22
- def order_score
22
+ def order
23
23
  if source["ChGroupOrder"]
24
24
  source["ChGroupOrder"].to_i
25
25
  end
@@ -24,6 +24,14 @@ module SyoboiCalendar
24
24
  def deleted?
25
25
  source["Deleted"] != "0"
26
26
  end
27
+ alias_method :deleted, :deleted?
28
+
29
+ # @return [Time, nil]
30
+ def finished_at
31
+ if source["EdTime"]
32
+ ::Time.parse(source["EdTime"])
33
+ end
34
+ end
27
35
 
28
36
  # @return [Integer, nil]
29
37
  def flag
@@ -44,13 +52,6 @@ module SyoboiCalendar
44
52
  source["ChiEPGName"]
45
53
  end
46
54
 
47
- # @return [Time, nil]
48
- def finished_at
49
- if source["EdTime"]
50
- ::Time.parse(source["EdTime"])
51
- end
52
- end
53
-
54
55
  # @return [Integer, nil]
55
56
  def revision
56
57
  if source["Revision"]
@@ -91,29 +91,29 @@ module SyoboiCalendar
91
91
  source["Title"]
92
92
  end
93
93
 
94
+ # @return [String, nil]
95
+ def short_title
96
+ source["ShortTitle"]
97
+ end
98
+
99
+ # @return [String, nil]
100
+ def sub_titles
101
+ source["SubTitles"]
102
+ end
103
+
94
104
  # @return [Integer, nil]
95
- def point
105
+ def user_point
96
106
  if source["UserPoint"]
97
107
  source["UserPoint"].to_i
98
108
  end
99
109
  end
100
110
 
101
111
  # @return [Integer, nil]
102
- def rank
112
+ def user_point_rank
103
113
  if source["UserPointRank"]
104
114
  source["UserPointRank"].to_i
105
115
  end
106
116
  end
107
-
108
- # @return [String, nil]
109
- def short_title
110
- source["ShortTitle"]
111
- end
112
-
113
- # @return [String, nil]
114
- def sub_titles
115
- source["SubTitles"]
116
- end
117
117
  end
118
118
  end
119
119
  end
@@ -1,3 +1,3 @@
1
1
  module SyoboiCalendar
2
- VERSION = "0.6.1"
2
+ VERSION = "0.7.0"
3
3
  end
@@ -570,8 +570,8 @@ describe ::SyoboiCalendar::Client do
570
570
  titles.first.english_name.should == "DummyEnglishTitle"
571
571
  titles.first.flag.should == 0
572
572
  titles.first.kana.should == "ダミータイトル"
573
- titles.first.point.should == 6
574
- titles.first.rank.should == 1
573
+ titles.first.user_point.should == 6
574
+ titles.first.user_point_rank.should == 1
575
575
  end
576
576
  end
577
577
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: syoboi_calendar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura