Completed
Push — master ( c0a386...56655a )
by Tobias
06:16 queued 03:48
created

ShowResponse::getIp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
/*
4
 * Copyright (C) 2013 Mailgun
5
 *
6
 * This software may be modified and distributed under the terms
7
 * of the MIT license. See the LICENSE file for details.
8
 */
9
10
namespace Mailgun\Model\Ip;
11
12
use Mailgun\Model\ApiResponse;
13
14
/**
15
 * @author Tobias Nyholm <[email protected]>
16
 */
17
final class ShowResponse implements ApiResponse
18
{
19
    /**
20
     * @var string
21
     */
22
    private $ip;
23
24
    /**
25
     * @var bool
26
     */
27
    private $dedicated;
28
29
    /**
30
     * @var string
31
     */
32
    private $rdns;
33
34 1
    private function __construct()
35
    {
36 1
    }
37
38 1
    public static function create(array $data)
39
    {
40 1
        $model = new self();
41 1
        $model->ip = $data['ip'];
42 1
        $model->dedicated = (bool) $data['dedicated'];
43 1
        $model->rdns = $data['rdns'];
44
45 1
        return $model;
46
    }
47
48
    /**
49
     * @return string
50
     */
51 1
    public function getIp()
52
    {
53 1
        return $this->ip;
54
    }
55
56
    /**
57
     * @return bool
58
     */
59 1
    public function getDedicated()
60
    {
61 1
        return $this->dedicated;
62
    }
63
64
    /**
65
     * @return string
66
     */
67 1
    public function getRdns()
68
    {
69 1
        return $this->rdns;
70
    }
71
}
72