class Flexibee::Node

Attributes

code[RW]

One node response in detail=full mode

{

id: "2",
lastUpdate: "2015-07-03T09:52:25.048+02:00",
kod: "root",
nazev: "Připojené položky",
nazevA: "",
nazevB: "",
nazevC: "",
strobr: "",
hladina: "2",
poradi: "1",
cesta: "1/1/",
kratkyPopis: "",
klicSlova: "",
popis: "",
txtNad: "",
txtPod: "",
strom: "code:STR_CEN",
strom@ref: "/c/woodies/strom-koren/1.json",
strom@showAs: "STR_CEN: Strom ceníku",
otec: "1",
otec@ref: "/c/woodies/strom/1.json",
otec@showAs: "Strom ceníku"

}

description[RW]

One node response in detail=full mode

{

id: "2",
lastUpdate: "2015-07-03T09:52:25.048+02:00",
kod: "root",
nazev: "Připojené položky",
nazevA: "",
nazevB: "",
nazevC: "",
strobr: "",
hladina: "2",
poradi: "1",
cesta: "1/1/",
kratkyPopis: "",
klicSlova: "",
popis: "",
txtNad: "",
txtPod: "",
strom: "code:STR_CEN",
strom@ref: "/c/woodies/strom-koren/1.json",
strom@showAs: "STR_CEN: Strom ceníku",
otec: "1",
otec@ref: "/c/woodies/strom/1.json",
otec@showAs: "Strom ceníku"

}

id[RW]

One node response in detail=full mode

{

id: "2",
lastUpdate: "2015-07-03T09:52:25.048+02:00",
kod: "root",
nazev: "Připojené položky",
nazevA: "",
nazevB: "",
nazevC: "",
strobr: "",
hladina: "2",
poradi: "1",
cesta: "1/1/",
kratkyPopis: "",
klicSlova: "",
popis: "",
txtNad: "",
txtPod: "",
strom: "code:STR_CEN",
strom@ref: "/c/woodies/strom-koren/1.json",
strom@showAs: "STR_CEN: Strom ceníku",
otec: "1",
otec@ref: "/c/woodies/strom/1.json",
otec@showAs: "Strom ceníku"

}

keywords[RW]

One node response in detail=full mode

{

id: "2",
lastUpdate: "2015-07-03T09:52:25.048+02:00",
kod: "root",
nazev: "Připojené položky",
nazevA: "",
nazevB: "",
nazevC: "",
strobr: "",
hladina: "2",
poradi: "1",
cesta: "1/1/",
kratkyPopis: "",
klicSlova: "",
popis: "",
txtNad: "",
txtPod: "",
strom: "code:STR_CEN",
strom@ref: "/c/woodies/strom-koren/1.json",
strom@showAs: "STR_CEN: Strom ceníku",
otec: "1",
otec@ref: "/c/woodies/strom/1.json",
otec@showAs: "Strom ceníku"

}

level[RW]

One node response in detail=full mode

{

id: "2",
lastUpdate: "2015-07-03T09:52:25.048+02:00",
kod: "root",
nazev: "Připojené položky",
nazevA: "",
nazevB: "",
nazevC: "",
strobr: "",
hladina: "2",
poradi: "1",
cesta: "1/1/",
kratkyPopis: "",
klicSlova: "",
popis: "",
txtNad: "",
txtPod: "",
strom: "code:STR_CEN",
strom@ref: "/c/woodies/strom-koren/1.json",
strom@showAs: "STR_CEN: Strom ceníku",
otec: "1",
otec@ref: "/c/woodies/strom/1.json",
otec@showAs: "Strom ceníku"

}

name[RW]

One node response in detail=full mode

{

id: "2",
lastUpdate: "2015-07-03T09:52:25.048+02:00",
kod: "root",
nazev: "Připojené položky",
nazevA: "",
nazevB: "",
nazevC: "",
strobr: "",
hladina: "2",
poradi: "1",
cesta: "1/1/",
kratkyPopis: "",
klicSlova: "",
popis: "",
txtNad: "",
txtPod: "",
strom: "code:STR_CEN",
strom@ref: "/c/woodies/strom-koren/1.json",
strom@showAs: "STR_CEN: Strom ceníku",
otec: "1",
otec@ref: "/c/woodies/strom/1.json",
otec@showAs: "Strom ceníku"

}

order[RW]

One node response in detail=full mode

{

id: "2",
lastUpdate: "2015-07-03T09:52:25.048+02:00",
kod: "root",
nazev: "Připojené položky",
nazevA: "",
nazevB: "",
nazevC: "",
strobr: "",
hladina: "2",
poradi: "1",
cesta: "1/1/",
kratkyPopis: "",
klicSlova: "",
popis: "",
txtNad: "",
txtPod: "",
strom: "code:STR_CEN",
strom@ref: "/c/woodies/strom-koren/1.json",
strom@showAs: "STR_CEN: Strom ceníku",
otec: "1",
otec@ref: "/c/woodies/strom/1.json",
otec@showAs: "Strom ceníku"

}

parent_id[RW]

One node response in detail=full mode

{

id: "2",
lastUpdate: "2015-07-03T09:52:25.048+02:00",
kod: "root",
nazev: "Připojené položky",
nazevA: "",
nazevB: "",
nazevC: "",
strobr: "",
hladina: "2",
poradi: "1",
cesta: "1/1/",
kratkyPopis: "",
klicSlova: "",
popis: "",
txtNad: "",
txtPod: "",
strom: "code:STR_CEN",
strom@ref: "/c/woodies/strom-koren/1.json",
strom@showAs: "STR_CEN: Strom ceníku",
otec: "1",
otec@ref: "/c/woodies/strom/1.json",
otec@showAs: "Strom ceníku"

}

parent_ref[RW]

One node response in detail=full mode

{

id: "2",
lastUpdate: "2015-07-03T09:52:25.048+02:00",
kod: "root",
nazev: "Připojené položky",
nazevA: "",
nazevB: "",
nazevC: "",
strobr: "",
hladina: "2",
poradi: "1",
cesta: "1/1/",
kratkyPopis: "",
klicSlova: "",
popis: "",
txtNad: "",
txtPod: "",
strom: "code:STR_CEN",
strom@ref: "/c/woodies/strom-koren/1.json",
strom@showAs: "STR_CEN: Strom ceníku",
otec: "1",
otec@ref: "/c/woodies/strom/1.json",
otec@showAs: "Strom ceníku"

}

route[RW]

One node response in detail=full mode

{

id: "2",
lastUpdate: "2015-07-03T09:52:25.048+02:00",
kod: "root",
nazev: "Připojené položky",
nazevA: "",
nazevB: "",
nazevC: "",
strobr: "",
hladina: "2",
poradi: "1",
cesta: "1/1/",
kratkyPopis: "",
klicSlova: "",
popis: "",
txtNad: "",
txtPod: "",
strom: "code:STR_CEN",
strom@ref: "/c/woodies/strom-koren/1.json",
strom@showAs: "STR_CEN: Strom ceníku",
otec: "1",
otec@ref: "/c/woodies/strom/1.json",
otec@showAs: "Strom ceníku"

}

short_description[RW]

One node response in detail=full mode

{

id: "2",
lastUpdate: "2015-07-03T09:52:25.048+02:00",
kod: "root",
nazev: "Připojené položky",
nazevA: "",
nazevB: "",
nazevC: "",
strobr: "",
hladina: "2",
poradi: "1",
cesta: "1/1/",
kratkyPopis: "",
klicSlova: "",
popis: "",
txtNad: "",
txtPod: "",
strom: "code:STR_CEN",
strom@ref: "/c/woodies/strom-koren/1.json",
strom@showAs: "STR_CEN: Strom ceníku",
otec: "1",
otec@ref: "/c/woodies/strom/1.json",
otec@showAs: "Strom ceníku"

}

tree[RW]

One node response in detail=full mode

{

id: "2",
lastUpdate: "2015-07-03T09:52:25.048+02:00",
kod: "root",
nazev: "Připojené položky",
nazevA: "",
nazevB: "",
nazevC: "",
strobr: "",
hladina: "2",
poradi: "1",
cesta: "1/1/",
kratkyPopis: "",
klicSlova: "",
popis: "",
txtNad: "",
txtPod: "",
strom: "code:STR_CEN",
strom@ref: "/c/woodies/strom-koren/1.json",
strom@showAs: "STR_CEN: Strom ceníku",
otec: "1",
otec@ref: "/c/woodies/strom/1.json",
otec@showAs: "Strom ceníku"

}

tree_ref[RW]

One node response in detail=full mode

{

id: "2",
lastUpdate: "2015-07-03T09:52:25.048+02:00",
kod: "root",
nazev: "Připojené položky",
nazevA: "",
nazevB: "",
nazevC: "",
strobr: "",
hladina: "2",
poradi: "1",
cesta: "1/1/",
kratkyPopis: "",
klicSlova: "",
popis: "",
txtNad: "",
txtPod: "",
strom: "code:STR_CEN",
strom@ref: "/c/woodies/strom-koren/1.json",
strom@showAs: "STR_CEN: Strom ceníku",
otec: "1",
otec@ref: "/c/woodies/strom/1.json",
otec@showAs: "Strom ceníku"

}

updated_at[RW]

One node response in detail=full mode

{

id: "2",
lastUpdate: "2015-07-03T09:52:25.048+02:00",
kod: "root",
nazev: "Připojené položky",
nazevA: "",
nazevB: "",
nazevC: "",
strobr: "",
hladina: "2",
poradi: "1",
cesta: "1/1/",
kratkyPopis: "",
klicSlova: "",
popis: "",
txtNad: "",
txtPod: "",
strom: "code:STR_CEN",
strom@ref: "/c/woodies/strom-koren/1.json",
strom@showAs: "STR_CEN: Strom ceníku",
otec: "1",
otec@ref: "/c/woodies/strom/1.json",
otec@showAs: "Strom ceníku"

}

Public Class Methods

new(response, tree) click to toggle source
# File lib/flexibee/node.rb, line 34
def initialize(response, tree)
  @id = response['id'].to_i
  @updated_at = response['lastUpdate']
  @code = response['kod']
  @name = response['nazev']
  @level = response['hladina'].to_i
  @order = response['poradi'].to_i
  @route = response['cesta']
  @short_description = response['kratkyPopis']
  @keywords = response['klicSlova']
  @description = response['popis']
  @tree_ref = response['strom@ref']
  @parent_id = response['otec'].to_i
  @parent_ref = response['otec@ref']
  @tree = tree
end

Public Instance Methods

descendants() click to toggle source

all children of the node

# File lib/flexibee/node.rb, line 54
def descendants
  tree.children_of(id)
end
parent() click to toggle source

parent of the node

# File lib/flexibee/node.rb, line 61
def parent
  tree.parent_for(parent_id).first
end