Class: Flexibee::Company

Inherits:
Object
  • Object
show all
Defined in:
lib/flexibee/company.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Company

Returns a new instance of Company.



23
24
25
26
27
28
29
# File 'lib/flexibee/company.rb', line 23

def initialize(response)
  @info = response['companies']['company']
  @id = response['companies']['company']['id']
  @name = response['companies']['company']['nazev']
  @db_name = response['companies']['company']['dbNazev']
  @created_at = response['companies']['company']['createDt']
end

Instance Attribute Details

#created_atObject

getting custom info from company response

{

"companies" => {
  "company" => {
    "createDt" => "2015-10-17T18:26:39.692+02:00",
    "dbNazev" => "esperia_test",
    "id" => "1",
    "licenseGroup" => "04fc91491a9647d451649736ad8127e2",
    "nazev" => "esperia-test",
    "show" => "true",
    "stavEnum" => "ESTABLISHED",
    "watchingChanges" => "false"
  }
}

}



21
22
23
# File 'lib/flexibee/company.rb', line 21

def created_at
  @created_at
end

#db_nameObject

getting custom info from company response

{

"companies" => {
  "company" => {
    "createDt" => "2015-10-17T18:26:39.692+02:00",
    "dbNazev" => "esperia_test",
    "id" => "1",
    "licenseGroup" => "04fc91491a9647d451649736ad8127e2",
    "nazev" => "esperia-test",
    "show" => "true",
    "stavEnum" => "ESTABLISHED",
    "watchingChanges" => "false"
  }
}

}



21
22
23
# File 'lib/flexibee/company.rb', line 21

def db_name
  @db_name
end

#idObject

getting custom info from company response

{

"companies" => {
  "company" => {
    "createDt" => "2015-10-17T18:26:39.692+02:00",
    "dbNazev" => "esperia_test",
    "id" => "1",
    "licenseGroup" => "04fc91491a9647d451649736ad8127e2",
    "nazev" => "esperia-test",
    "show" => "true",
    "stavEnum" => "ESTABLISHED",
    "watchingChanges" => "false"
  }
}

}



21
22
23
# File 'lib/flexibee/company.rb', line 21

def id
  @id
end

#infoObject

getting custom info from company response

{

"companies" => {
  "company" => {
    "createDt" => "2015-10-17T18:26:39.692+02:00",
    "dbNazev" => "esperia_test",
    "id" => "1",
    "licenseGroup" => "04fc91491a9647d451649736ad8127e2",
    "nazev" => "esperia-test",
    "show" => "true",
    "stavEnum" => "ESTABLISHED",
    "watchingChanges" => "false"
  }
}

}



21
22
23
# File 'lib/flexibee/company.rb', line 21

def info
  @info
end

#nameObject

getting custom info from company response

{

"companies" => {
  "company" => {
    "createDt" => "2015-10-17T18:26:39.692+02:00",
    "dbNazev" => "esperia_test",
    "id" => "1",
    "licenseGroup" => "04fc91491a9647d451649736ad8127e2",
    "nazev" => "esperia-test",
    "show" => "true",
    "stavEnum" => "ESTABLISHED",
    "watchingChanges" => "false"
  }
}

}



21
22
23
# File 'lib/flexibee/company.rb', line 21

def name
  @name
end