Module: Memobird
- Defined in:
- lib/memobird.rb,
lib/memobird/version.rb
Overview
Memobird API wrapper
Constant Summary collapse
- HOST =
'http://open.memobird.cn/home'.freeze
- API_RETRIEVE_USER_ID =
"#{HOST}/setuserbind".freeze
- API_PRINT_CONTENT =
"#{HOST}/printpaper".freeze
- VERSION =
'0.1.0'.freeze
Class Attribute Summary collapse
-
.api_key ⇒ Object
Returns the value of attribute api_key.
-
.memobird_id ⇒ Object
Returns the value of attribute memobird_id.
-
.user_id ⇒ Object
Returns the value of attribute user_id.
-
.user_identifying ⇒ Object
Returns the value of attribute user_identifying.
Class Method Summary collapse
Class Attribute Details
.api_key ⇒ Object
Returns the value of attribute api_key.
15 16 17 |
# File 'lib/memobird.rb', line 15 def api_key @api_key end |
.memobird_id ⇒ Object
Returns the value of attribute memobird_id.
15 16 17 |
# File 'lib/memobird.rb', line 15 def memobird_id @memobird_id end |
.user_id ⇒ Object
Returns the value of attribute user_id.
15 16 17 |
# File 'lib/memobird.rb', line 15 def user_id @user_id end |
.user_identifying ⇒ Object
Returns the value of attribute user_identifying.
15 16 17 |
# File 'lib/memobird.rb', line 15 def @user_identifying end |
Class Method Details
.print_content(content = {}) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/memobird.rb', line 17 def print_content(content = {}) raise 'Please set up first' if not_ready? load_user_id if user_id.nil? puts content response = http_get(build_url(API_PRINT_CONTENT, userid: user_id, printcontent: build_print_content(content))) puts response['showapi_res_error'].to_s + ' ' + response['printcontentid'].to_s rescue StandardError => e puts 'Print content error. ' + e. end |