Class: Stastic::Command::Set

Inherits:
Base
  • Object
show all
Defined in:
lib/stastic/commands/set.rb

Constant Summary collapse

VALID_SETTINGS =
[:site_root, :site_id]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = []) ⇒ Set

Returns a new instance of Set.



7
8
9
10
11
12
13
14
15
# File 'lib/stastic/commands/set.rb', line 7

def initialize(args = [])
  case args.size
  when 0
    raise(Stastic::Command::InvalidOptions)
  else
    self.settings = parse_args(args)
    validate_settings(settings)
  end
end

Instance Attribute Details

#settingsObject

Returns the value of attribute settings.



3
4
5
# File 'lib/stastic/commands/set.rb', line 3

def settings
  @settings
end

Instance Method Details

#indexObject



17
18
19
# File 'lib/stastic/commands/set.rb', line 17

def index
  update_settings(settings)
end