class Element

This class represent the top abstraction of an element. Specifies common behavior.

Attributes

id[R]
short_name[R]

Public Class Methods

new(id, s_name, links, type_for_links) click to toggle source

initializes the common behavior this class specifies.

# File lib/Appolo/Models/element.rb, line 12
def initialize (id, s_name, links, type_for_links)
  @id = id
  @short_name = s_name
  @links = Links.new(links, type_for_links) unless links.nil?
end

Public Instance Methods

check_json_info(json_info) click to toggle source
# File lib/Appolo/Models/element.rb, line 18
def check_json_info(json_info)
  if json_info.is_a? Hash
    json_data = json_info
  else
    json_data = JSON.parse json_info
  end
  json_data
end