module Requisite

Constants

VERSION

Public Instance Methods

first_attribute_from_model(*attributes) click to toggle source
# File lib/requisite/api_model.rb, line 88
def first_attribute_from_model(*attributes)
  attributes.each do |attribute|
    value = attribute_from_model(attribute)
    if value && !(value.kind_of?(Hash) && value.empty?)
      return value
    end
  end
  nil
end
model_responds_to_attribute_query?(name) click to toggle source
# File lib/requisite/api_model.rb, line 98
def model_responds_to_attribute_query?(name)
  if @model.kind_of?(Hash)
    @model[name] != nil
  else
    @model.send(name) if @model.respond_to?(name)
  end
end
preprocess_model() click to toggle source
# File lib/requisite/api_model.rb, line 106
def preprocess_model
  # noop
end