Class: EmojiClockFetcher
- Inherits:
-
Object
- Object
- EmojiClockFetcher
- Defined in:
- lib/emoji_clock/emoji_clock_fetcher.rb
Constant Summary collapse
- EMOJI_CLOCK_CODE_POINT =
0x1F550
Instance Method Summary collapse
- #exact_fetch ⇒ Object
- #fetch ⇒ Object
-
#initialize(hour, minute) ⇒ EmojiClockFetcher
constructor
A new instance of EmojiClockFetcher.
Constructor Details
#initialize(hour, minute) ⇒ EmojiClockFetcher
Returns a new instance of EmojiClockFetcher.
6 7 8 9 |
# File 'lib/emoji_clock/emoji_clock_fetcher.rb', line 6 def initialize(hour, minute) @hour = hour @minute = minute end |
Instance Method Details
#exact_fetch ⇒ Object
16 17 18 |
# File 'lib/emoji_clock/emoji_clock_fetcher.rb', line 16 def exact_fetch fetch if [0, 30].include?(@minute) end |
#fetch ⇒ Object
11 12 13 14 |
# File 'lib/emoji_clock/emoji_clock_fetcher.rb', line 11 def fetch code_point = EMOJI_CLOCK_CODE_POINT + hour_offset + minute_offset [code_point].pack('U') end |