class OneApi::PartOfUrlFieldConversionRule

Public Class Methods

new(json_field_name=nil,part_index) click to toggle source
Calls superclass method OneApi::FieldConversionRule::new
# File lib/oneapi-ruby/objects.rb, line 102
def initialize(json_field_name=nil,part_index)
    super(json_field_name)
                @part_index = part_index;
end

Public Instance Methods

from_json(value) click to toggle source
# File lib/oneapi-ruby/objects.rb, line 107
def from_json(value)
    if ! value
        return nil
    end

    parts = value.split('/')

    parts[@part_index]
end
to_json(value) click to toggle source
# File lib/oneapi-ruby/objects.rb, line 117
def to_json(value)
    value
end