Class: Grape::Formatter::Builder
- Inherits:
-
Object
- Object
- Grape::Formatter::Builder
- Defined in:
- lib/grape/formatter/builder.rb
Instance Attribute Summary collapse
-
#endpoint ⇒ Object
readonly
Returns the value of attribute endpoint.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#object ⇒ Object
readonly
Returns the value of attribute object.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(object, env) ⇒ Builder
constructor
A new instance of Builder.
Constructor Details
#initialize(object, env) ⇒ Builder
Returns a new instance of Builder.
10 11 12 13 |
# File 'lib/grape/formatter/builder.rb', line 10 def initialize(object, env) @object, @env = object, env @endpoint = env['api.endpoint'] end |
Instance Attribute Details
#endpoint ⇒ Object (readonly)
Returns the value of attribute endpoint.
4 5 6 |
# File 'lib/grape/formatter/builder.rb', line 4 def endpoint @endpoint end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
4 5 6 |
# File 'lib/grape/formatter/builder.rb', line 4 def env @env end |
#object ⇒ Object (readonly)
Returns the value of attribute object.
4 5 6 |
# File 'lib/grape/formatter/builder.rb', line 4 def object @object end |
Class Method Details
.call(object, env) ⇒ Object
6 7 8 |
# File 'lib/grape/formatter/builder.rb', line 6 def self.call(object, env) new(object, env).call end |