class Iugu::APIChildResource
Public Class Methods
new(parent_keys = {}, fabricator)
click to toggle source
# File lib/iugu/api_child_resource.rb, line 6 def initialize(parent_keys = {}, fabricator) @parent_keys = parent_keys @fabricator = fabricator end
Public Instance Methods
create(attributes = {})
click to toggle source
# File lib/iugu/api_child_resource.rb, line 11 def create(attributes = {}) @fabricator.send "create", merge_params(attributes) end
fetch(options = nil)
click to toggle source
# File lib/iugu/api_child_resource.rb, line 19 def fetch(options = nil) @fabricator.send "fetch", merge_params({ id: options }) end
search(options = {})
click to toggle source
# File lib/iugu/api_child_resource.rb, line 15 def search(options = {}) @fabricator.send "search", merge_params(options) end
Private Instance Methods
merge_params(attributes)
click to toggle source
# File lib/iugu/api_child_resource.rb, line 25 def merge_params(attributes) @parent_keys.merge attributes end