Class: Proz::WiwoEntries
- Inherits:
-
Object
- Object
- Proz::WiwoEntries
- Includes:
- HTTParty
- Defined in:
- lib/proz/wiwo_entries.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Instance Method Summary collapse
- #entries ⇒ Object
- #filtered_entries(**options) ⇒ Object
-
#initialize(key:) ⇒ WiwoEntries
constructor
A new instance of WiwoEntries.
- #users ⇒ Object
- #wiwos ⇒ Object
Constructor Details
#initialize(key:) ⇒ WiwoEntries
Returns a new instance of WiwoEntries.
9 10 11 |
# File 'lib/proz/wiwo_entries.rb', line 9 def initialize(key:) @key = key end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
8 9 10 |
# File 'lib/proz/wiwo_entries.rb', line 8 def key @key end |
Instance Method Details
#entries ⇒ Object
13 14 15 |
# File 'lib/proz/wiwo_entries.rb', line 13 def entries all_wiwos end |
#filtered_entries(**options) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/proz/wiwo_entries.rb', line 25 def filtered_entries(**) if [:user_uuid] user_uuid_query = "user_uuid=" + [:user_uuid] + '&' else user_uuid_query = "" end if [:keyword] keyword_query = "message_contains=" + URI.encode([:keyword], /\W/) + '&' else keyword_query = "" end if [:min_time] min_time_query = "min_time=" + URI.encode([:min_time]) + '&' else min_time_query = "" end self.class.get("/wiwo?" + user_uuid_query + keyword_query + min_time_query, headers: { 'X-Proz-API-Key' => key }) end |
#users ⇒ Object
21 22 23 |
# File 'lib/proz/wiwo_entries.rb', line 21 def users all_wiwos["users"] end |
#wiwos ⇒ Object
17 18 19 |
# File 'lib/proz/wiwo_entries.rb', line 17 def wiwos all_wiwos["wiwos"] end |