module Intelipost::FluentInterface

Public Class Methods

included(cls) click to toggle source
# File lib/intelipost/fluent_interface.rb, line 4
def self.included(cls)
  cls.extend(ClassMethods)
end

Public Instance Methods

create(post_values) click to toggle source
# File lib/intelipost/fluent_interface.rb, line 8
def create(post_values)
  connection.post(@fluent_interfaces.join('/'), post_values)
end
get(value) click to toggle source
# File lib/intelipost/fluent_interface.rb, line 16
def get(value)
  connection.get([@fluent_interfaces, value].join('/'))
end
method_missing(method, *args, &block) click to toggle source
# File lib/intelipost/fluent_interface.rb, line 20
def method_missing(method, *args, &block)
  add_fluent_interface_path(method)
  self
end
update(post_values) click to toggle source
# File lib/intelipost/fluent_interface.rb, line 12
def update(post_values)
  create(post_values)
end

Private Instance Methods

add_fluent_interface_path(method) click to toggle source
# File lib/intelipost/fluent_interface.rb, line 26
def add_fluent_interface_path(method)
  @fluent_interfaces << method
end