Class: CodecovApi::Objects::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/codecov_api/objects/base.rb

Direct Known Subclasses

Author, FolderTotals

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ Base



6
7
8
# File 'lib/codecov_api/objects/base.rb', line 6

def initialize(json)
  @data = JSON.parse(json.to_s)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object (private)



22
23
24
25
# File 'lib/codecov_api/objects/base.rb', line 22

def method_missing(method, *args, &block)
  super unless valid_methods.include? method
  root_element[method.to_s]
end