Exception: MindMeisterClient::ApiCallRequiredError

Inherits:
Exception
  • Object
show all
Defined in:
lib/mind_meister_client/api_call_required_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg, api_call_url) ⇒ ApiCallRequiredError

Returns a new instance of ApiCallRequiredError.

Parameters:

  • msg (String)
  • api_call_url (String)


9
10
11
12
# File 'lib/mind_meister_client/api_call_required_error.rb', line 9

def initialize msg, api_call_url
  @msg = msg
  @api_call_url = api_call_url
end

Instance Attribute Details

#api_call_urlObject

Returns the value of attribute api_call_url.



5
6
7
# File 'lib/mind_meister_client/api_call_required_error.rb', line 5

def api_call_url
  @api_call_url
end

#msgObject

Returns the value of attribute msg.



3
4
5
# File 'lib/mind_meister_client/api_call_required_error.rb', line 3

def msg
  @msg
end

#templateObject

Returns the value of attribute template.



4
5
6
# File 'lib/mind_meister_client/api_call_required_error.rb', line 4

def template
  @template
end

Instance Method Details

#setup_templateObject



25
26
27
# File 'lib/mind_meister_client/api_call_required_error.rb', line 25

def setup_template
  @template = '%{msg}: %{api_call_url}'
end

#to_sObject



14
15
16
17
18
19
20
21
22
23
# File 'lib/mind_meister_client/api_call_required_error.rb', line 14

def to_s
  setup_template unless @template

  data = {
    api_call_url: @api_call_url,
    msg: @msg
  }

  @template%data
end