Class: PrxAuth::ScopeList::Entry

Inherits:
Struct
  • Object
show all
Defined in:
lib/prx_auth/scope_list.rb,
lib/prx_auth/scope_list.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#namespaceObject

Returns the value of attribute namespace

Returns:

  • (Object)

    the current value of namespace



7
8
9
# File 'lib/prx_auth/scope_list.rb', line 7

def namespace
  @namespace
end

#scopeObject

Returns the value of attribute scope

Returns:

  • (Object)

    the current value of scope



7
8
9
# File 'lib/prx_auth/scope_list.rb', line 7

def scope
  @scope
end

#stringObject

Returns the value of attribute string

Returns:

  • (Object)

    the current value of string



7
8
9
# File 'lib/prx_auth/scope_list.rb', line 7

def string
  @string
end

Instance Method Details

#==(other) ⇒ Object



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

def ==(other)
  namespace == other.namespace && scope == other.scope
end

#inspectObject



30
31
32
# File 'lib/prx_auth/scope_list.rb', line 30

def inspect
  "#<ScopeList::Entry \"#{self}\">"
end

#namespaced?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/prx_auth/scope_list.rb', line 18

def namespaced?
  !(namespace.nil? || namespace == NO_NAMESPACE)
end

#to_sObject



14
15
16
# File 'lib/prx_auth/scope_list.rb', line 14

def to_s
  string
end

#unnamespacedObject



22
23
24
25
26
27
28
# File 'lib/prx_auth/scope_list.rb', line 22

def unnamespaced
  if namespaced?
    Entry.new(NO_NAMESPACE, scope, string.split(":").last)
  else
    self
  end
end