class Pagseguro::Charge::InstructionLines

Credit card data

Attributes

line_1[RW]
line_2[RW]

Public Class Methods

fill_from_json(data) click to toggle source
# File lib/pagseguro/charge/instruction_lines.rb, line 20
def self.fill_from_json(data)
  return if data.nil?

  instruction_line = new
  instruction_line.line_1 = data["line_1"]
  instruction_line.line_2 = data["line_2"]
  instruction_line
end
new(args = {}) click to toggle source
# File lib/pagseguro/charge/instruction_lines.rb, line 9
def initialize(args = {})
  @line_1 = args[:line_1]
  @line_2 = args[:line_2]
end

Public Instance Methods

as_json(options={}) click to toggle source
# File lib/pagseguro/charge/instruction_lines.rb, line 29
def as_json(options={})
  {
    line_1: @line_1,
    line_2: @line_2
  }
end
to_json(*options) click to toggle source
# File lib/pagseguro/charge/instruction_lines.rb, line 14
def to_json(*options)
  hash = as_json(*options)
  hash.reject! {|k,v| v.nil?}
  hash.to_json(*options)
end