Class: Core::Io::Json::Grammar::Actions

Inherits:
Object
  • Object
show all
Includes:
Intermediate, Resource
Defined in:
app/api/core/io/json/grammar.rb

Instance Attribute Summary

Attributes included from Intermediate

#children

Instance Method Summary collapse

Methods included from Resource

#resource_details

Methods included from Intermediate

#[], #leaf, #merge_children_with

Constructor Details

#initialize(endpoint, children = nil) ⇒ Actions

Returns a new instance of Actions


188
189
190
191
# File 'app/api/core/io/json/grammar.rb', line 188

def initialize(endpoint, children = nil)
  super(children)
  @endpoint = endpoint
end

Instance Method Details

#actions(object, options, stream) ⇒ Object


197
198
199
# File 'app/api/core/io/json/grammar.rb', line 197

def actions(object, options, stream)
  process_children(object, options, stream)
end

#call(object, options, stream) ⇒ Object


193
194
195
# File 'app/api/core/io/json/grammar.rb', line 193

def call(object, options, stream)
  resource_details(@endpoint, object, options, stream)
end

#dupObject


205
206
207
# File 'app/api/core/io/json/grammar.rb', line 205

def dup
  self.class.new(@endpoint)
end

#inspectObject


209
210
211
# File 'app/api/core/io/json/grammar.rb', line 209

def inspect
  "Actions<#{super}>"
end

#merge(_) ⇒ Object


201
202
203
# File 'app/api/core/io/json/grammar.rb', line 201

def merge(_)
  raise 'Cannot merge into an actions leaf as it is actions only!'
end