Module: AirbnbApi::Service::ClassMethods

Included in:
Listing, Thread, Token
Defined in:
lib/airbnb_api/service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#parametersObject

Returns the value of attribute parameters.



12
13
14
# File 'lib/airbnb_api/service.rb', line 12

def parameters
  @parameters
end

#pathObject

Returns the value of attribute path.



12
13
14
# File 'lib/airbnb_api/service.rb', line 12

def path
  @path
end

#requires_oauth_tokenObject (readonly)

Returns the value of attribute requires_oauth_token.



13
14
15
# File 'lib/airbnb_api/service.rb', line 13

def requires_oauth_token
  @requires_oauth_token
end

Instance Method Details

#can_use_client?(client) ⇒ Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/airbnb_api/service.rb', line 27

def can_use_client?(client)
  requires_oauth_token? == client.oauth_token?
end

#require_oauth_tokenObject



23
24
25
# File 'lib/airbnb_api/service.rb', line 23

def require_oauth_token
  @requires_oauth_token = true
end

#requires_oauth_token?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/airbnb_api/service.rb', line 31

def requires_oauth_token?
  @requires_oauth_token == true
end

#set_parameter(parameter, default) ⇒ Object



18
19
20
21
# File 'lib/airbnb_api/service.rb', line 18

def set_parameter(parameter, default)
  @parameters ||= {}
  @parameters[parameter.to_sym] = default
end

#set_path(path) ⇒ Object



14
15
16
# File 'lib/airbnb_api/service.rb', line 14

def set_path(path)
  @path = path
end