class Zomato2::EntityBase

Public Class Methods

new(zomato_conn) click to toggle source
# File lib/zomato2/entity_base.rb, line 4
def initialize(zomato_conn)
  @zom_conn = zomato_conn
end

Public Instance Methods

get(endpoint, params) click to toggle source
# File lib/zomato2/entity_base.rb, line 8
def get(endpoint, params)
  @zom_conn.get(endpoint, params)
end
to_s() click to toggle source
# File lib/zomato2/entity_base.rb, line 12
def to_s
  #self.inspect
  vals = self.instance_variables.map do |att|
     next nil if att === :@zom_conn
     attstr = att.to_s.sub('@','')
     attstr+": #{self.instance_variable_get(att)}"
  end

  classname = self.class.name.sub(/.*:/,'')
  fields = vals.compact.join ', '
  "#{classname}: { #{fields} }"
end