Class: Blix::Rest::RequestMapper::TableNode

Inherits:
Object
  • Object
show all
Defined in:
lib/blix/rest/request_mapper.rb

Overview

the

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ TableNode

Returns a new instance of TableNode.



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/blix/rest/request_mapper.rb', line 28

def initialize(name)
  @children = {}
  if name[0, 1] == ':'
    @parameter = name[1..-1].to_sym
    @value     = WILD_PLACEHOLDER
  elsif name[0, 1] == '*'
    @parameter = if name[1..-1].empty?
                   :wildpath
                 else
                   name[1..-1].to_sym
                 end
    @value = STAR_PLACEHOLDER
  else
    @value = name
  end
  @extract_format = true
end

Instance Attribute Details

#blkObject

Returns the value of attribute blk.



21
22
23
# File 'lib/blix/rest/request_mapper.rb', line 21

def blk
  @blk
end

#childrenObject (readonly)

Returns the value of attribute children.



25
26
27
# File 'lib/blix/rest/request_mapper.rb', line 25

def children
  @children
end

#extract_formatObject

Returns the value of attribute extract_format.



26
27
28
# File 'lib/blix/rest/request_mapper.rb', line 26

def extract_format
  @extract_format
end

#optsObject

Returns the value of attribute opts.



23
24
25
# File 'lib/blix/rest/request_mapper.rb', line 23

def opts
  @opts
end

#parameterObject (readonly)

Returns the value of attribute parameter.



24
25
26
# File 'lib/blix/rest/request_mapper.rb', line 24

def parameter
  @parameter
end

#valueObject (readonly)

Returns the value of attribute value.



22
23
24
# File 'lib/blix/rest/request_mapper.rb', line 22

def value
  @value
end

Instance Method Details

#[](k) ⇒ Object



46
47
48
# File 'lib/blix/rest/request_mapper.rb', line 46

def [](k)
  @children[k]
end

#[]=(k, v) ⇒ Object



50
51
52
# File 'lib/blix/rest/request_mapper.rb', line 50

def []=(k, v)
  @children[k] = v
end