som-timer 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/som_timer.rb +158 -0
  3. metadata +29 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fba04d660865cbe1ad1cc2e4beecff34dc2d02db91c7772df77344ab78b79a3b
4
- data.tar.gz: 9d2f76f99181a7314f3079b5df431653ed3d970644fa42f554bf67970d605e6a
3
+ metadata.gz: a66053e517a1e779658da89901d8fff1c45199db86c92411c754cc28c72f299a
4
+ data.tar.gz: feaa3d6a8990aa3dc6542ebd9a8cc1ac790d044088c137bd04b64a3aa929e715
5
5
  SHA512:
6
- metadata.gz: 97867c4c4a1ed4a7ee60a9085abc14e45a61ed904050e33c412b736ea8d001a06b42b92c837480a53fdd0fb281cd1ad1b2200312584714e9b36fbe591fecebf6
7
- data.tar.gz: 102bd6251dfaef0f8c695be8991601c7b511bbe185c15871ae2da13c790d2726c5fbe36092580436b62d4f62d255e41df1a37973140ac63150cb4a8222d59c25
6
+ metadata.gz: d676ffb31d552ea4c1a6249757d20b8f91430db2bd5a6a39c99277ccf2c9676e3ceb749ecad8fbaae0bb1753aced3ad26df9bf7a4d94aad763d75f2e8ed48fc8
7
+ data.tar.gz: 1e5e9ca8e5d391fb0860c069ad0f5bdda630afc7eb6f69ffed13b9099c90100df0f6a1e73c8e9b8345d65674132d4d70d5618f48b76f3cca22c22024789e8b88
@@ -2,33 +2,191 @@ require "faraday"
2
2
  require "pry"
3
3
  require "json"
4
4
 
5
+ gem 'rdoc'
6
+ require 'rdoc/rdoc'
7
+
8
+ options = RDoc::Options.new
9
+ # see RDoc::Options
10
+
11
+ rdoc = RDoc::RDoc.new
12
+ rdoc.document options
13
+ # see RDoc::RDoc
14
+
5
15
  class SomTimer
16
+ ##
17
+ # Learn more about Som Timer
18
+ #
19
+ # Example:
20
+ # >> SomTimer.hello_world
21
+ # Hello World! This is SomTimer, a timer that cares.
22
+ #
23
+ # Based on the pomodoro technique™️, this application provides users with curated wellness content during break intervals.
24
+ #
25
+ # Build in rest, so you can focus best.
26
+
6
27
  def self.hello_world
7
28
  puts "Hello World! This is SomTimer, a timer that cares.
8
29
  \nBased on the pomodoro technique™️, this application provides users with curated wellness content during break intervals.
9
30
  \nBuild in rest, so you can focus best."
10
31
  end
11
32
 
33
+ ##
34
+ # Update Timer 1
35
+ #
36
+ # Example:
37
+ # >> SomTimer.update_timer("45:00", "10:00", "chordCliff")
38
+ # => #<SomTimer::Timer:0x00007fc9481db9d8 @id=1, @work_interval="45:00", @rest_interval="10:00", @sound="chordCliff">
39
+ # Accessing Attributes:
40
+ # >> timer = SomTimer.update_timer("45:00", "10:00", "chordCliff")
41
+ # => #<SomTimer::Timer:0x00007fc9481db9d8 @id=1, @work_interval="45:00", @rest_interval="10:00", @sound="chordCliff">
42
+ # >> timer.id
43
+ # => 1
44
+ # >> timer.work_interval
45
+ # => "45:00"
46
+ # >> timer.rest_interval
47
+ # => "10:00"
48
+ # >> timer.sound
49
+ # => "chordCliff"
50
+ #
51
+ # Arguments:
52
+ # work_interval: Time in minutes (string)
53
+ # rest: Time in minutes valid options: "5", "7", "10" (string)
54
+ # sound: Sound name valid options: "balineseGong", "birdChord", "goodOldSynths", "levelUp", "pianoDreams", "reverbSplash" (string)
55
+
12
56
  def self.update_timer(work_interval, rest_interval, sound, path = "timers/1")
13
57
  TimerFacade.new(path).update_timer(work_interval, rest_interval, sound)
14
58
  end
15
59
 
60
+ ## GET Timer 1
61
+ #
62
+ # Example:
63
+ # >> SomTimer.one_timer
64
+ # => #<SomTimer::Timer:0x00007fbe38903c08 @id=1, @work_interval="45:00", @rest_interval="5", @sound="reverbSplash">
65
+ # Accessing Attributes:
66
+ # >> timer = SomTimer.one_timer
67
+ # => #<SomTimer::Timer:0x00007fbe38903c08 @id=1, @work_interval="45:00", @rest_interval="5", @sound="reverbSplash">
68
+ # >> timer.id
69
+ # => 1
70
+ # >> timer.work_interval
71
+ # => "45:00"
72
+ # >> timer.rest_interval
73
+ # => "5"
74
+ # >> timer.sound
75
+ # => "reverbSplash"
76
+
16
77
  def self.one_timer(path = "timers/1")
17
78
  TimerFacade.new(path).one_timer
18
79
  end
19
80
 
81
+ ##
82
+ # GET Random Exercise
83
+ #
84
+ # Example:
85
+ # >> SomTimer.rand_exercise("10:00", "MOVEMENT")
86
+ # => #<SomTimer::Exercise:0x00007fbe370fd820 @id=16, @url="https://www.youtube.com/watch?v=KJaWIBg15n0&ab_channel=ExtremeFitnessPro", @duration="10:00", @category="MOVEMENT">
87
+ # Accessing Attributes:
88
+ # >> random_exercise = SomTimer.rand_exercise("10:00", "MOVEMENT")
89
+ # => #<SomTimer::Exercise:0x00007fbe370fd820 @id=16, @url="https://www.youtube.com/watch?v=KJaWIBg15n0&ab_channel=ExtremeFitnessPro", @duration="10:00", @category="MOVEMENT">
90
+ # >> random_exercise.id
91
+ # => 16
92
+ # >> random_exercise.url
93
+ # => "https://www.youtube.com/watch?v=KJaWIBg15n0&ab_channel=ExtremeFitnessPro"
94
+ # >> random_exercise.duration
95
+ # => "10:00"
96
+ # >> random_exercise.category
97
+ # => "MOVEMENT"
98
+ #
99
+ # Arguments:
100
+ # duration: Time in minutes (string)
101
+ # category: Somatic Category of choice. Valid options: "MOVEMENT", "MEDITATION", "Somatic" (string)
102
+
20
103
  def self.rand_exercise(duration, category, path = "rand_exercise")
21
104
  ExerciseFacade.new(path).rand_exercise(duration, category)
22
105
  end
23
106
 
107
+ ## GET all Exercises
108
+ #
109
+ # Example:
110
+ # >> SomTimer.exercises
111
+ # => [...] (array of all exercises)
112
+ # Accessing Attributes:
113
+ # >> exercises = SomTimer.exercises
114
+ # => [...] (array of all exercises)
115
+ # >> excersises.count
116
+ # => 33
117
+ # >> exercise_1 = exercises[0]
118
+ # => #<SomTimer::Exercise:0x00007fbe37a1f390 @id=1, @url="https://www.youtube.com/watch?v=W5wqniA4MMc&ab_channel=EssentialSomatics", @duration="10:00", @category="MEDITATION">
119
+ # >> exercise_1.id
120
+ # => 1
121
+ # >> exercise_1.url
122
+ # => "https://www.youtube.com/watch?v=W5wqniA4MMc&ab_channel=EssentialSomatics"
123
+ # >> exercise_1.duration
124
+ # => "10:00"
125
+ # >> exercise_1.category
126
+ # => "MEDITATION"
127
+
24
128
  def self.exercises(path = "exercises")
25
129
  ExerciseFacade.new(path).exercises
26
130
  end
27
131
 
132
+ ## GET all Rests
133
+ #
134
+ # Example:
135
+ # >> SomTimer.rests
136
+ # => [...] (array of all rests)
137
+ # Accessing Attributes:
138
+ # >> rests = SomTimer.rests
139
+ # => [...] (array of all rests)
140
+ # >> rests.count
141
+ # => 19
142
+ # >> rest_1 = rests[0]
143
+ # => #<SomTimer::Rest:0x00007fbe391b5770 @id=1, @mood_rating_1=3, @mood_rating_2=5, @content_selected="MOVEMENT", @focus_interval="25", @rest_interval="5">
144
+ # >> rest_1.id
145
+ # => 1
146
+ # >> rest_1.mood_rating_1
147
+ # => 3
148
+ # >> rest_1.mood_rating_2
149
+ # => 5
150
+ # >> rest_1.category_selected
151
+ # => "MOVEMENT"
152
+ # >> rest_1.focus_interval
153
+ # => "25"
154
+ # >> rest_1.rest_interval
155
+ # => "5"
156
+
28
157
  def self.rests(path = "rests")
29
158
  RestFacade.new(path).rests
30
159
  end
31
160
 
161
+ ##
162
+ # Create Rest
163
+ #
164
+ # Example:
165
+ # >> SomTimer.create_rest(3, 4, "MEDITATION", "25:00", "5")
166
+ # =>
167
+ # Accessing Attributes:
168
+ # >> rest = SomTimer.SomTimer.create_rest(3, 4, "MEDITATION", "25:00", "5")
169
+ # =>
170
+ # >> rest.id
171
+ # => 1
172
+ # >> rest.mood_rating_1
173
+ # => 3
174
+ # >> rest.mood_rating_2
175
+ # => 4
176
+ # >> rest.category_selected
177
+ # => "MEDITATION"
178
+ # >> rest.focus_interval
179
+ # => "25:00"
180
+ # >> rest.rest_interval
181
+ # => "5"
182
+ #
183
+ # Arguments:
184
+ # mood_rating_1: mood before rest interval on a scale from 1-5 (integer)
185
+ # mood_rating_2: mood after rest interval on a scale from 1-5 (integer)
186
+ # category_selected: Somatic Category chosen during rest interval. Valid options: "MOVEMENT", "MEDITATION", "Somatic" (string)
187
+ # focus_interval: Time in minutes of focus time (string)
188
+ # rest_interval: Time in minutes for rest time valid options: "5", "7", "10" (string)
189
+
32
190
  def self.create_rest(mood_rating_1, mood_rating_2, content_selected, focus_interval, rest_interval, path = "rests")
33
191
  RestFacade.new(path).create_rest(mood_rating_1, mood_rating_2, content_selected, focus_interval, rest_interval)
34
192
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: som-timer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sienna Kopf
@@ -24,6 +24,34 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rdoc
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: mocha
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
27
55
  description: A ruby library for accessing API endpoints of the SomTimer application.
28
56
  email: princess.kopf@gmail.com
29
57
  executables: []