Class: Grape::Namespace
- Inherits:
-
Object
- Object
- Grape::Namespace
- Defined in:
- lib/grape/namespace.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#space ⇒ Object
readonly
Returns the value of attribute space.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(space, options = {}) ⇒ Namespace
constructor
options: requirements: a hash.
- #requirements ⇒ Object
Constructor Details
#initialize(space, options = {}) ⇒ Namespace
options: requirements: a hash
7 8 9 |
# File 'lib/grape/namespace.rb', line 7 def initialize(space, = {}) @space, @options = space.to_s, end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/grape/namespace.rb', line 3 def @options end |
#space ⇒ Object (readonly)
Returns the value of attribute space.
3 4 5 |
# File 'lib/grape/namespace.rb', line 3 def space @space end |
Class Method Details
.joined_space(settings) ⇒ Object
15 16 17 |
# File 'lib/grape/namespace.rb', line 15 def self.joined_space(settings) settings.gather(:namespace).map(&:space).join("/") end |
.joined_space_path(settings) ⇒ Object
19 20 21 |
# File 'lib/grape/namespace.rb', line 19 def self.joined_space_path(settings) Rack::Mount::Utils.normalize_path(joined_space(settings)) end |
Instance Method Details
#requirements ⇒ Object
11 12 13 |
# File 'lib/grape/namespace.rb', line 11 def requirements [:requirements] || {} end |