Class: Stastic::Command::Domains
- Defined in:
- lib/stastic/commands/domains.rb
Instance Attribute Summary collapse
-
#domain_name ⇒ Object
Returns the value of attribute domain_name.
Instance Method Summary collapse
- #add ⇒ Object
- #index ⇒ Object
-
#initialize(args = []) ⇒ Domains
constructor
A new instance of Domains.
- #remove ⇒ Object
Constructor Details
#initialize(args = []) ⇒ Domains
Returns a new instance of Domains.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/stastic/commands/domains.rb', line 5 def initialize(args = []) case args.size when 1 self.domain_name = args.first raise(Stastic::Command::InvalidOptions) unless validate_domain(domain_name) else raise(Stastic::Command::InvalidOptions) end end |
Instance Attribute Details
#domain_name ⇒ Object
Returns the value of attribute domain_name.
3 4 5 |
# File 'lib/stastic/commands/domains.rb', line 3 def domain_name @domain_name end |
Instance Method Details
#add ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/stastic/commands/domains.rb', line 19 def add print "Adding domain #{domain_name}... " with_valid_site do Stastic::Client.add_domain(Stastic::Config.site_id, domain_name) end puts "Success\n" end |
#index ⇒ Object
16 17 |
# File 'lib/stastic/commands/domains.rb', line 16 def index end |
#remove ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/stastic/commands/domains.rb', line 27 def remove print "Removing domain #{domain_name}... " with_valid_site do Stastic::Client.remove_domain(Stastic::Config.site_id, domain_name) end puts "Success\n" end |