Class: Appwrite::Models::DomainPrice
- Inherits:
-
Object
- Object
- Appwrite::Models::DomainPrice
- Defined in:
- lib/appwrite/models/domain_price.rb
Instance Attribute Summary collapse
-
#available ⇒ Object
readonly
Returns the value of attribute available.
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#period_years ⇒ Object
readonly
Returns the value of attribute period_years.
-
#premium ⇒ Object
readonly
Returns the value of attribute premium.
-
#price ⇒ Object
readonly
Returns the value of attribute price.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
-
#renewal_period_years ⇒ Object
readonly
Returns the value of attribute renewal_period_years.
-
#renewal_price ⇒ Object
readonly
Returns the value of attribute renewal_price.
-
#tld ⇒ Object
readonly
Returns the value of attribute tld.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(domain:, tld:, available:, price: nil, period_years:, premium:, renewal_price: nil, renewal_period_years:, reason: nil) ⇒ DomainPrice
constructor
A new instance of DomainPrice.
- #to_map ⇒ Object
Constructor Details
#initialize(domain:, tld:, available:, price: nil, period_years:, premium:, renewal_price: nil, renewal_period_years:, reason: nil) ⇒ DomainPrice
Returns a new instance of DomainPrice.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/appwrite/models/domain_price.rb', line 16 def initialize( domain:, tld:, available:, price: nil, period_years:, premium:, renewal_price: nil, renewal_period_years:, reason: nil ) @domain = domain @tld = tld @available = available @price = price @period_years = period_years @premium = premium @renewal_price = renewal_price @renewal_period_years = renewal_period_years @reason = reason end |
Instance Attribute Details
#available ⇒ Object (readonly)
Returns the value of attribute available.
8 9 10 |
# File 'lib/appwrite/models/domain_price.rb', line 8 def available @available end |
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
6 7 8 |
# File 'lib/appwrite/models/domain_price.rb', line 6 def domain @domain end |
#period_years ⇒ Object (readonly)
Returns the value of attribute period_years.
10 11 12 |
# File 'lib/appwrite/models/domain_price.rb', line 10 def period_years @period_years end |
#premium ⇒ Object (readonly)
Returns the value of attribute premium.
11 12 13 |
# File 'lib/appwrite/models/domain_price.rb', line 11 def premium @premium end |
#price ⇒ Object (readonly)
Returns the value of attribute price.
9 10 11 |
# File 'lib/appwrite/models/domain_price.rb', line 9 def price @price end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
14 15 16 |
# File 'lib/appwrite/models/domain_price.rb', line 14 def reason @reason end |
#renewal_period_years ⇒ Object (readonly)
Returns the value of attribute renewal_period_years.
13 14 15 |
# File 'lib/appwrite/models/domain_price.rb', line 13 def renewal_period_years @renewal_period_years end |
#renewal_price ⇒ Object (readonly)
Returns the value of attribute renewal_price.
12 13 14 |
# File 'lib/appwrite/models/domain_price.rb', line 12 def renewal_price @renewal_price end |
#tld ⇒ Object (readonly)
Returns the value of attribute tld.
7 8 9 |
# File 'lib/appwrite/models/domain_price.rb', line 7 def tld @tld end |
Class Method Details
.from(map:) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/appwrite/models/domain_price.rb', line 38 def self.from(map:) map = { "domain" => "", "tld" => "", "available" => false, "periodYears" => 1, "premium" => false, "renewalPeriodYears" => 1 }.merge(map) DomainPrice.new( domain: map["domain"], tld: map["tld"], available: map["available"], price: map["price"], period_years: map["periodYears"], premium: map["premium"], renewal_price: map["renewalPrice"], renewal_period_years: map["renewalPeriodYears"], reason: map["reason"] ) end |
Instance Method Details
#to_map ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/appwrite/models/domain_price.rb', line 53 def to_map { "domain": @domain, "tld": @tld, "available": @available, "price": @price, "periodYears": @period_years, "premium": @premium, "renewalPrice": @renewal_price, "renewalPeriodYears": @renewal_period_years, "reason": @reason } end |