Class: ParserAction::Wrap

Inherits:
Ruby show all
Defined in:
lib/ejson/parser_action/wrap.rb

Constant Summary

Constants inherited from Ruby

Ruby::UNICODE_ESCAPER

Instance Method Summary collapse

Methods inherited from Ruby

#make_array, #make_date, #make_empty_array, #make_empty_object, #make_false, #make_identifier, #make_null, #make_number, #make_number_as_string, #make_number_long, #make_numeric_string, #make_object, #make_pair, #make_regexp, #make_root, #make_string, #make_true

Methods included from AbstractMongo

#make_date, #make_number_long, #make_regexp

Methods included from AbstractJSON

#make_array, #make_empty_array, #make_empty_object, #make_false, #make_identifier, #make_null, #make_number, #make_object, #make_pair, #make_root, #make_string, #make_true

Instance Method Details

#make_bin_data(_input, _starts_at, _ends_at, elements) ⇒ Object



13
14
15
16
17
18
# File 'lib/ejson/parser_action/wrap.rb', line 13

def make_bin_data(_input, _starts_at, _ends_at, elements)
  data = elements.last
  type = elements.first

  ::Wrap::BinData.new(type, data)
end

#make_db_ref(_input, _starts_at, _ends_at, elements) ⇒ Object



28
29
30
# File 'lib/ejson/parser_action/wrap.rb', line 28

def make_db_ref(_input, _starts_at, _ends_at, elements)
  ::Wrap::DBRef.new(elements.first, elements.last)
end

#make_max_key(_input, _starts_at, _ends_at) ⇒ Object



36
37
38
# File 'lib/ejson/parser_action/wrap.rb', line 36

def make_max_key(_input, _starts_at, _ends_at)
  ::Wrap::MaxKey
end

#make_min_key(_input, _starts_at, _ends_at) ⇒ Object



32
33
34
# File 'lib/ejson/parser_action/wrap.rb', line 32

def make_min_key(_input, _starts_at, _ends_at)
  ::Wrap::MinKey
end

#make_number_decimal(_input, _starts_at, _ends_at, elements) ⇒ Object



24
25
26
# File 'lib/ejson/parser_action/wrap.rb', line 24

def make_number_decimal(_input, _starts_at, _ends_at, elements)
  BigDecimal(elements.first)
end

#make_object_id(_input, _starts_at, _ends_at, elements) ⇒ Object



7
8
9
10
11
# File 'lib/ejson/parser_action/wrap.rb', line 7

def make_object_id(_input, _starts_at, _ends_at, elements)
  value = elements.first

  ::Wrap::ObjectId.new(value)
end

#make_timestamp(_input, _starts_at, _ends_at, elements) ⇒ Object



20
21
22
# File 'lib/ejson/parser_action/wrap.rb', line 20

def make_timestamp(_input, _starts_at, _ends_at, elements)
  ::Wrap::Timestamp.new(elements.first, elements.last)
end

#make_undefined(_input, _starts_at, _ends_at) ⇒ Object



40
41
42
# File 'lib/ejson/parser_action/wrap.rb', line 40

def make_undefined(_input, _starts_at, _ends_at)
  ::Wrap::Undefined
end