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.



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

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

Instance Method Details

#actions(object, options, stream) ⇒ Object



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

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

#call(object, options, stream) ⇒ Object



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

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

#dupObject



217
218
219
# File 'app/api/core/io/json/grammar.rb', line 217

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

#inspectObject



221
222
223
# File 'app/api/core/io/json/grammar.rb', line 221

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

#merge(_) ⇒ Object



213
214
215
# File 'app/api/core/io/json/grammar.rb', line 213

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