Class: Hapyrus::Command::Base
- Inherits:
-
Object
- Object
- Hapyrus::Command::Base
- Defined in:
- lib/hapyrus/command/base.rb
Instance Method Summary collapse
- #ask ⇒ Object
- #display_index ⇒ Object
- #display_show(id) ⇒ Object
- #hapyrus ⇒ Object
- #index ⇒ Object
-
#initialize ⇒ Base
constructor
A new instance of Base.
- #show(id) ⇒ Object
Constructor Details
Instance Method Details
#ask ⇒ Object
11 |
# File 'lib/hapyrus/command/base.rb', line 11 def ask; gets.strip end |
#display_index ⇒ Object
15 16 17 |
# File 'lib/hapyrus/command/base.rb', line 15 def display_index pp @result.first end |
#display_show(id) ⇒ Object
21 22 23 |
# File 'lib/hapyrus/command/base.rb', line 21 def display_show(id) pp @result end |
#hapyrus ⇒ Object
10 |
# File 'lib/hapyrus/command/base.rb', line 10 def hapyrus; @api_client end |
#index ⇒ Object
12 13 14 |
# File 'lib/hapyrus/command/base.rb', line 12 def index @result = JSON.parse hapyrus.get(class_name_to_path) end |
#show(id) ⇒ Object
18 19 20 |
# File 'lib/hapyrus/command/base.rb', line 18 def show(id) @result = JSON.parse hapyrus.get("#{class_name_to_path}/#{id}") end |