Class: Doorkeeper::GrantFlow::Flow

Inherits:
Object
  • Object
show all
Defined in:
lib/doorkeeper/grant_flow/flow.rb

Direct Known Subclasses

FallbackFlow

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, **options) ⇒ Flow

Returns a new instance of Flow.



10
11
12
13
14
15
16
17
# File 'lib/doorkeeper/grant_flow/flow.rb', line 10

def initialize(name, **options)
  @name = name
  @grant_type_matches = options[:grant_type_matches]
  @grant_type_strategy = options[:grant_type_strategy]
  @response_type_matches = options[:response_type_matches]
  @response_type_strategy = options[:response_type_strategy]
  @response_mode_matches = options[:response_mode_matches]
end

Instance Attribute Details

#grant_type_matchesObject (readonly)

Returns the value of attribute grant_type_matches.



6
7
8
# File 'lib/doorkeeper/grant_flow/flow.rb', line 6

def grant_type_matches
  @grant_type_matches
end

#grant_type_strategyObject (readonly)

Returns the value of attribute grant_type_strategy.



6
7
8
# File 'lib/doorkeeper/grant_flow/flow.rb', line 6

def grant_type_strategy
  @grant_type_strategy
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/doorkeeper/grant_flow/flow.rb', line 6

def name
  @name
end

#response_mode_matchesObject (readonly)

Returns the value of attribute response_mode_matches.



6
7
8
# File 'lib/doorkeeper/grant_flow/flow.rb', line 6

def response_mode_matches
  @response_mode_matches
end

#response_type_matchesObject (readonly)

Returns the value of attribute response_type_matches.



6
7
8
# File 'lib/doorkeeper/grant_flow/flow.rb', line 6

def response_type_matches
  @response_type_matches
end

#response_type_strategyObject (readonly)

Returns the value of attribute response_type_strategy.



6
7
8
# File 'lib/doorkeeper/grant_flow/flow.rb', line 6

def response_type_strategy
  @response_type_strategy
end

Instance Method Details

#default_response_modeObject



35
36
37
# File 'lib/doorkeeper/grant_flow/flow.rb', line 35

def default_response_mode
  response_mode_matches[0]
end

#handles_grant_type?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/doorkeeper/grant_flow/flow.rb', line 19

def handles_grant_type?
  grant_type_matches.present?
end

#handles_response_type?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/doorkeeper/grant_flow/flow.rb', line 23

def handles_response_type?
  response_type_matches.present?
end

#matches_grant_type?(value) ⇒ Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/doorkeeper/grant_flow/flow.rb', line 27

def matches_grant_type?(value)
  grant_type_matches === value
end

#matches_response_mode?(value) ⇒ Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/doorkeeper/grant_flow/flow.rb', line 39

def matches_response_mode?(value)
  response_mode_matches.include?(value)
end

#matches_response_type?(value) ⇒ Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/doorkeeper/grant_flow/flow.rb', line 31

def matches_response_type?(value)
  response_type_matches === value
end