Class: ShortcutRuby::Shortcut

Inherits:
Object
  • Object
show all
Includes:
PathBuilder
Defined in:
lib/shortcut_ruby.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from PathBuilder

#clear_path, included, #method_missing, #respond_to_missing?

Constructor Details

#initialize(token, response_format: :json) ⇒ Shortcut

This is the basic object to interact with the shortcut api. An api token is required, and optionally the response format can be set.

Raises:

  • (ArgumentError)


15
16
17
18
19
20
# File 'lib/shortcut_ruby.rb', line 15

def initialize(token, response_format: :json)
  raise ArgumentError unless input_valid?(token, response_format)

  self.token = token
  self.response_format = response_format
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ShortcutRuby::PathBuilder

Instance Attribute Details

#response_formatObject

Returns the value of attribute response_format.



10
11
12
# File 'lib/shortcut_ruby.rb', line 10

def response_format
  @response_format
end

#tokenObject

Returns the value of attribute token.



10
11
12
# File 'lib/shortcut_ruby.rb', line 10

def token
  @token
end