Class: GrapeSlate::ExampleGenerator::Shell

Inherits:
Object
  • Object
show all
Defined in:
lib/grape-slate/example_generator/shell.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(route, resource) ⇒ Shell

Returns a new instance of Shell.



7
8
9
10
# File 'lib/grape-slate/example_generator/shell.rb', line 7

def initialize(route, resource)
  @route    = route
  @resource = resource
end

Instance Attribute Details

#resourceObject (readonly)

Returns the value of attribute resource.



2
3
4
# File 'lib/grape-slate/example_generator/shell.rb', line 2

def resource
  @resource
end

#routeObject (readonly)

Returns the value of attribute route.



2
3
4
# File 'lib/grape-slate/example_generator/shell.rb', line 2

def route
  @route
end

Instance Method Details

#example_bindingObject



16
17
18
# File 'lib/grape-slate/example_generator/shell.rb', line 16

def example_binding
  binding
end

#linesObject



12
13
14
# File 'lib/grape-slate/example_generator/shell.rb', line 12

def lines
  @lines ||= [command, request, data, headers, verbose].flatten.compact
end